mirror of
https://github.com/modernweb-dev/rocket.git
synced 2026-03-21 08:51:18 +00:00
Compare commits
6 Commits
@rocket/se
...
@rocket/cl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14721d1e0f | ||
|
|
0f6709ac4b | ||
|
|
ed86ff2346 | ||
|
|
c675820163 | ||
|
|
f4a0ab559f | ||
|
|
a8cdaebab1 |
@@ -1,5 +1,13 @@
|
||||
# @rocket/cli
|
||||
|
||||
## 0.6.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- ed86ff2: Do not set `data-localize-lang` in the simulator iframe html tag
|
||||
- f4a0ab5: Pass document shadowRoot to iframe
|
||||
- c675820: fix: windows path issue avoid filtering of index section of collections
|
||||
|
||||
## 0.6.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@rocket/cli",
|
||||
"version": "0.6.1",
|
||||
"version": "0.6.2",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
@@ -73,6 +73,7 @@
|
||||
"fs-extra": "^9.0.1",
|
||||
"micromatch": "^4.0.2",
|
||||
"plugins-manager": "^0.2.1",
|
||||
"slash": "^3.0.0",
|
||||
"utf8": "^3.0.0"
|
||||
},
|
||||
"types": "dist-types/index.d.ts"
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
if (urlParts.get('language')) {
|
||||
document.documentElement.setAttribute('lang', urlParts.get('language'));
|
||||
document.documentElement.setAttribute('data-lang', urlParts.get('language'));
|
||||
document.documentElement.setAttribute('data-localize-lang', urlParts.get('language'));
|
||||
}
|
||||
if (urlParts.get('story-key')) {
|
||||
document.documentElement.setAttribute('story-key', urlParts.get('story-key'));
|
||||
@@ -47,7 +46,7 @@
|
||||
}
|
||||
|
||||
const mod = await import(urlParts.get('story-file'));
|
||||
render(mod[urlParts.get('story-key')](), document.body);
|
||||
render(mod[urlParts.get('story-key')]({ shadowRoot: document }), document.body);
|
||||
}
|
||||
|
||||
window.addEventListener('hashchange', onHashChange, false);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const slash = require('slash');
|
||||
const { readdirSync } = require('fs');
|
||||
|
||||
function getDirectories(source) {
|
||||
@@ -23,7 +24,7 @@ const rocketCollections = {
|
||||
let docs = [
|
||||
...collection.getFilteredByGlob(`${_inputDirCwdRelative}/${section}/**/*.md`),
|
||||
];
|
||||
docs = docs.filter(page => page.inputPath !== `./${indexSection}`);
|
||||
docs = docs.filter(page => page.inputPath !== `./${slash(indexSection)}`);
|
||||
|
||||
return docs;
|
||||
});
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
"preset"
|
||||
],
|
||||
"dependencies": {
|
||||
"@rocket/drawer": "^0.1.2",
|
||||
"@rocket/drawer": "^0.1.3",
|
||||
"@rocket/navigation": "^0.2.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @mdjs/mdjs-preview
|
||||
|
||||
## 0.4.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 0f6709a: Make sure initial settings are taken from the element if nothing is yet stored
|
||||
|
||||
## 0.4.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@mdjs/mdjs-preview",
|
||||
"version": "0.4.0",
|
||||
"version": "0.4.1",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
|
||||
@@ -72,7 +72,7 @@ export class MdJsPreview extends LitElement {
|
||||
this.languages = [
|
||||
{ key: 'en', name: 'English' },
|
||||
{ key: 'en-US', name: 'English (United States)' },
|
||||
{ key: 'en-US', name: 'English (United Kingdom)' },
|
||||
{ key: 'en-GB', name: 'English (United Kingdom)' },
|
||||
{ key: 'de', name: 'German' },
|
||||
{ key: 'es', name: 'Spanish' },
|
||||
{ key: 'fi', name: 'Finnish' },
|
||||
|
||||
@@ -40,6 +40,8 @@ function storeSettings() {
|
||||
}
|
||||
}
|
||||
|
||||
let hasGlobalStateBeenSetBefore = false;
|
||||
|
||||
function restoreSettings() {
|
||||
for (const _sharedStateKey of Object.keys(_sharedStates)) {
|
||||
const sharedStateKey = /** @type {keyof _sharedStates} */ (_sharedStateKey);
|
||||
@@ -55,6 +57,7 @@ function restoreSettings() {
|
||||
default:
|
||||
_sharedStates[sharedStateKey] = restoredValue;
|
||||
}
|
||||
hasGlobalStateBeenSetBefore = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,27 +69,30 @@ restoreSettings();
|
||||
* @param {import('./MdJsPreview.js').MdJsPreview} target
|
||||
*/
|
||||
export function applySharedStates(target) {
|
||||
for (const _sharedStateKey of Object.keys(_sharedStates)) {
|
||||
const sharedStateKey = /** @type {keyof _sharedStates} */ (_sharedStateKey);
|
||||
switch (sharedStateKey) {
|
||||
case 'autoHeight':
|
||||
case 'deviceMode':
|
||||
case 'rememberSettings':
|
||||
case 'edgeDistance':
|
||||
target[sharedStateKey] = _sharedStates[sharedStateKey];
|
||||
break;
|
||||
default:
|
||||
target[sharedStateKey] = _sharedStates[sharedStateKey];
|
||||
if (hasGlobalStateBeenSetBefore) {
|
||||
for (const _sharedStateKey of Object.keys(_sharedStates)) {
|
||||
const sharedStateKey = /** @type {keyof _sharedStates} */ (_sharedStateKey);
|
||||
switch (sharedStateKey) {
|
||||
case 'autoHeight':
|
||||
case 'deviceMode':
|
||||
case 'rememberSettings':
|
||||
case 'edgeDistance':
|
||||
target[sharedStateKey] = _sharedStates[sharedStateKey];
|
||||
break;
|
||||
default:
|
||||
target[sharedStateKey] = _sharedStates[sharedStateKey];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
_saveToSharedStates(target);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {import('./MdJsPreview.js').MdJsPreview} target
|
||||
* @param {Function} subscribedFn
|
||||
*/
|
||||
export function saveToSharedStates(target, subscribedFn) {
|
||||
function _saveToSharedStates(target) {
|
||||
let updated = false;
|
||||
for (const _sharedStateKey of Object.keys(_sharedStates)) {
|
||||
const sharedStateKey = /** @type {keyof _sharedStates} */ (_sharedStateKey);
|
||||
@@ -102,8 +108,19 @@ export function saveToSharedStates(target, subscribedFn) {
|
||||
_sharedStates[sharedStateKey] = target[sharedStateKey];
|
||||
}
|
||||
updated = true;
|
||||
hasGlobalStateBeenSetBefore = true;
|
||||
}
|
||||
}
|
||||
return updated;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {import('./MdJsPreview.js').MdJsPreview} target
|
||||
* @param {Function} subscribedFn
|
||||
*/
|
||||
export function saveToSharedStates(target, subscribedFn) {
|
||||
const updated = _saveToSharedStates(target);
|
||||
if (updated) {
|
||||
storeSettings();
|
||||
for (const subscribeFn of subscribeFns) {
|
||||
|
||||
Reference in New Issue
Block a user