@niscorp/moss 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @niscorp/moss
|
|
2
2
|
|
|
3
|
+
## 0.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2548e43: `domTarget({ root, registry })` with an app's own registry no longer injects nova's reference stylesheet or puts its class on the root — both restyled the app's kit over the app's own CSS. With no registry (the reference kit) nothing changes.
|
|
8
|
+
|
|
3
9
|
## 0.2.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -15,8 +15,11 @@ var injectCss = (doc) => {
|
|
|
15
15
|
};
|
|
16
16
|
var domTarget = (config) => (api) => {
|
|
17
17
|
const { root } = config;
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
const reference = config.registry === void 0;
|
|
19
|
+
if (reference) {
|
|
20
|
+
injectCss(root.ownerDocument);
|
|
21
|
+
root.classList.add(components.ROOT_CLASS);
|
|
22
|
+
}
|
|
20
23
|
const registry = config.registry ?? components.defaultRegistry();
|
|
21
24
|
const view = dom.createDomView(root, registry, api, { fallback: components.fallback });
|
|
22
25
|
view.render();
|
|
@@ -24,7 +27,7 @@ var domTarget = (config) => (api) => {
|
|
|
24
27
|
update: view.render,
|
|
25
28
|
destroy: () => {
|
|
26
29
|
view.destroy();
|
|
27
|
-
root.classList.remove(components.ROOT_CLASS);
|
|
30
|
+
if (reference) root.classList.remove(components.ROOT_CLASS);
|
|
28
31
|
}
|
|
29
32
|
};
|
|
30
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/terminal/dom/index.ts"],"names":["DEFAULT_CSS","ROOT_CLASS","defaultRegistry","createDomView","fallback"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"sources":["../../../src/terminal/dom/index.ts"],"names":["D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scorp/nova/adapters/dom';\nimport type { DomComponent } from '@niscorp/nova/adapters/dom';\nimport { defaultRegistry, fallback, DEFAULT_CSS, ROOT_CLASS } from '@niscorp/nova/adapters/dom/components';\nimport type { ComponentRegistry } from '@niscorp/nova';\nimport type { Target } from '../index';\n\n// ═══════════════════════════════════════════════════════════\n// @niscorp/moss/terminal/dom — the plain-DOM render target: the conductor's\n// wire, nova's DOM adapter, and nova's default reference kit. Zero framework\n// — the lightest terminal, and the proof that the terminal is trivial and\n// the intelligence is server-side. Bring a `root`; omit `registry` for the\n// batteries — nova's reference kit AND its stylesheet, with its class on the\n// root. Pass your own `registry` and the look is yours too: nothing is injected\n// and the root gets no class. (The reference stylesheet used to come along\n// either way, and restyled an app's own kit over the app's own CSS.)\n// ═══════════════════════════════════════════════════════════\n\n// One stylesheet per document (a page may host more than one root, and a swap\n// re-mounts) — a WeakSet, not a module boolean, so it's per-document truth.\nconst styled = new WeakSet<Document>();\nconst injectCss = (doc: Document): void => {\n if (styled.has(doc)) return;\n const style = doc.createElement('style');\n style.setAttribute('data-nova-dom', '');\n style.textContent = DEFAULT_CSS;\n doc.head.appendChild(style);\n styled.add(doc);\n};\n\nexport const domTarget = (config: { root: HTMLElement; registry?: ComponentRegistry<DomComponent> }): Target => (api) => {\n const { root } = config;\n // the reference kit's look belongs to the reference kit\n const reference = config.registry === undefined;\n if (reference) {\n injectCss(root.ownerDocument);\n root.classList.add(ROOT_CLASS);\n }\n const registry = config.registry ?? defaultRegistry();\n // TerminalApi and nova's DomRenderApi are the same shape (frame / canvasTree\n // / dispatch / publish) — hand it straight through.\n const view = createDomView(root, registry, api, { fallback });\n view.render();\n return {\n update: view.render,\n destroy: () => {\n view.destroy();\n if (reference) root.classList.remove(ROOT_CLASS);\n },\n };\n};\n"]}
|
|
@@ -13,8 +13,11 @@ var injectCss = (doc) => {
|
|
|
13
13
|
};
|
|
14
14
|
var domTarget = (config) => (api) => {
|
|
15
15
|
const { root } = config;
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
const reference = config.registry === void 0;
|
|
17
|
+
if (reference) {
|
|
18
|
+
injectCss(root.ownerDocument);
|
|
19
|
+
root.classList.add(ROOT_CLASS);
|
|
20
|
+
}
|
|
18
21
|
const registry = config.registry ?? defaultRegistry();
|
|
19
22
|
const view = createDomView(root, registry, api, { fallback });
|
|
20
23
|
view.render();
|
|
@@ -22,7 +25,7 @@ var domTarget = (config) => (api) => {
|
|
|
22
25
|
update: view.render,
|
|
23
26
|
destroy: () => {
|
|
24
27
|
view.destroy();
|
|
25
|
-
root.classList.remove(ROOT_CLASS);
|
|
28
|
+
if (reference) root.classList.remove(ROOT_CLASS);
|
|
26
29
|
}
|
|
27
30
|
};
|
|
28
31
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/terminal/dom/index.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"sources":["../../../src/terminal/dom/index.ts"],"names":[],"mappings":";;;;AAmBA,IAAM,MAAA,uBAAa,OAAA,EAAkB;AACrC,IAAM,SAAA,GAAY,CAAC,GAAA,KAAwB;AACzC,EAAA,IAAI,MAAA,CAAO,GAAA,CAAI,GAAG,CAAA,EAAG;AACrB,EAAA,MAAM,KAAA,GAAQ,GAAA,CAAI,aAAA,CAAc,OAAO,CAAA;AACvC,EAAA,KAAA,CAAM,YAAA,CAAa,iBAAiB,EAAE,CAAA;AACtC,EAAA,KAAA,CAAM,WAAA,GAAc,WAAA;AACpB,EAAA,GAAA,CAAI,IAAA,CAAK,YAAY,KAAK,CAAA;AAC1B,EAAA,MAAA,CAAO,IAAI,GAAG,CAAA;AAChB,CAAA;AAEO,IAAM,SAAA,GAAY,CAAC,MAAA,KAAsF,CAAC,GAAA,KAAQ;AACvH,EAAA,MAAM,EAAE,MAAK,GAAI,MAAA;AAEjB,EAAA,MAAM,SAAA,GAAY,OAAO,QAAA,KAAa,MAAA;AACtC,EAAA,IAAI,SAAA,EAAW;AACb,IAAA,SAAA,CAAU,KAAK,aAAa,CAAA;AAC5B,IAAA,IAAA,CAAK,SAAA,CAAU,IAAI,UAAU,CAAA;AAAA,EAC/B;AACA,EAAA,MAAM,QAAA,GAAW,MAAA,CAAO,QAAA,IAAY,eAAA,EAAgB;AAGpD,EAAA,MAAM,OAAO,aAAA,CAAc,IAAA,EAAM,UAAU,GAAA,EAAK,EAAE,UAAU,CAAA;AAC5D,EAAA,IAAA,CAAK,MAAA,EAAO;AACZ,EAAA,OAAO;AAAA,IACL,QAAQ,IAAA,CAAK,MAAA;AAAA,IACb,SAAS,MAAM;AACb,MAAA,IAAA,CAAK,OAAA,EAAQ;AACb,MAAA,IAAI,SAAA,EAAW,IAAA,CAAK,SAAA,CAAU,MAAA,CAAO,UAAU,CAAA;AAAA,IACjD;AAAA,GACF;AACF","file":"index.js","sourcesContent":["import { createDomView } from '@niscorp/nova/adapters/dom';\nimport type { DomComponent } from '@niscorp/nova/adapters/dom';\nimport { defaultRegistry, fallback, DEFAULT_CSS, ROOT_CLASS } from '@niscorp/nova/adapters/dom/components';\nimport type { ComponentRegistry } from '@niscorp/nova';\nimport type { Target } from '../index';\n\n// ═══════════════════════════════════════════════════════════\n// @niscorp/moss/terminal/dom — the plain-DOM render target: the conductor's\n// wire, nova's DOM adapter, and nova's default reference kit. Zero framework\n// — the lightest terminal, and the proof that the terminal is trivial and\n// the intelligence is server-side. Bring a `root`; omit `registry` for the\n// batteries — nova's reference kit AND its stylesheet, with its class on the\n// root. Pass your own `registry` and the look is yours too: nothing is injected\n// and the root gets no class. (The reference stylesheet used to come along\n// either way, and restyled an app's own kit over the app's own CSS.)\n// ═══════════════════════════════════════════════════════════\n\n// One stylesheet per document (a page may host more than one root, and a swap\n// re-mounts) — a WeakSet, not a module boolean, so it's per-document truth.\nconst styled = new WeakSet<Document>();\nconst injectCss = (doc: Document): void => {\n if (styled.has(doc)) return;\n const style = doc.createElement('style');\n style.setAttribute('data-nova-dom', '');\n style.textContent = DEFAULT_CSS;\n doc.head.appendChild(style);\n styled.add(doc);\n};\n\nexport const domTarget = (config: { root: HTMLElement; registry?: ComponentRegistry<DomComponent> }): Target => (api) => {\n const { root } = config;\n // the reference kit's look belongs to the reference kit\n const reference = config.registry === undefined;\n if (reference) {\n injectCss(root.ownerDocument);\n root.classList.add(ROOT_CLASS);\n }\n const registry = config.registry ?? defaultRegistry();\n // TerminalApi and nova's DomRenderApi are the same shape (frame / canvasTree\n // / dispatch / publish) — hand it straight through.\n const view = createDomView(root, registry, api, { fallback });\n view.render();\n return {\n update: view.render,\n destroy: () => {\n view.destroy();\n if (reference) root.classList.remove(ROOT_CLASS);\n },\n };\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@niscorp/moss",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "moss — the nisc app server: serves existence (catalog, scoped vex, the socket), derived from artifacts",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -171,10 +171,10 @@
|
|
|
171
171
|
"zod": "^4.2.0",
|
|
172
172
|
"vue": "^3.5.0",
|
|
173
173
|
"vite": ">=6",
|
|
174
|
-
"@niscorp/nova": "^0.1.1",
|
|
175
174
|
"@niscorp/charter": "^0.1.0",
|
|
176
|
-
"@niscorp/
|
|
175
|
+
"@niscorp/nova": "^0.1.1",
|
|
177
176
|
"@niscorp/strata": "^0.1.0",
|
|
177
|
+
"@niscorp/tide": "^0.1.0",
|
|
178
178
|
"@niscorp/vex": "^0.1.0",
|
|
179
179
|
"@niscorp/prism": "^0.1.1"
|
|
180
180
|
},
|
|
@@ -212,11 +212,11 @@
|
|
|
212
212
|
"vue": "^3.5.43",
|
|
213
213
|
"zod": "^4.6.5",
|
|
214
214
|
"@niscorp/charter": "^0.1.0",
|
|
215
|
+
"@niscorp/prism": "^0.1.1",
|
|
216
|
+
"@niscorp/strata": "^0.1.0",
|
|
215
217
|
"@niscorp/nova": "^0.1.1",
|
|
216
218
|
"@niscorp/tide": "^0.1.0",
|
|
217
|
-
"@niscorp/
|
|
218
|
-
"@niscorp/vex": "^0.1.0",
|
|
219
|
-
"@niscorp/prism": "^0.1.1"
|
|
219
|
+
"@niscorp/vex": "^0.1.0"
|
|
220
220
|
},
|
|
221
221
|
"scripts": {
|
|
222
222
|
"build": "node -e \"fs.rmSync('dist',{recursive:true,force:true})\" && tsup",
|