nodality 1.0.168 → 1.0.171
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/dist/bundle.umd.js +2 -1
- package/dist/bundle.umd.js.LICENSE.txt +33 -0
- package/dist/finalresult.esm.js +2 -1
- package/dist/finalresult.esm.js.LICENSE.txt +60 -0
- package/dist/index.cjs.js +2 -1
- package/dist/index.cjs.js.LICENSE.txt +60 -0
- package/dist/index.esm.js +2 -1
- package/dist/index.esm.js.LICENSE.txt +60 -0
- package/layout/animator.js +1 -1
- package/layout/audio.js +1 -1
- package/layout/audionew.js +1 -1
- package/layout/base-2.js +1 -1
- package/layout/base.js +1 -1
- package/layout/beta-desktop-bar.js +1 -1
- package/layout/beta-mobile-bar.js +1 -1
- package/layout/box.js +1 -1
- package/layout/button.js +1 -1
- package/layout/cards.js +1 -1
- package/layout/center.js +1 -1
- package/layout/checkbox.js +1 -1
- package/layout/circle.js +1 -1
- package/layout/clean-row.js +1 -1
- package/layout/code.js +1 -1
- package/layout/container.js +1 -1
- package/layout/custom.js +1 -1
- package/layout/div-image.js +1 -1
- package/layout/dropdown-2025.js +1 -1
- package/layout/dropdown.js +1 -1
- package/layout/empty-element.js +1 -1
- package/layout/external-stylesheet.js +1 -1
- package/layout/flex-card.js +1 -1
- package/layout/flex-grid.js +1 -1
- package/layout/flex-row.js +1 -1
- package/layout/footer.js +1 -1
- package/layout/form-components/custom.js +1 -1
- package/layout/form-components/data-list.js +1 -1
- package/layout/form-components/floating-input.js +1 -1
- package/layout/form-components/form-all.js +1 -1
- package/layout/form-components/form.js +1 -1
- package/layout/form-components/image-picker.js +1 -1
- package/layout/form-components/picker.js +1 -1
- package/layout/form-components/radio.js +1 -1
- package/layout/form-components/radiogroup.js +1 -1
- package/layout/form-components/range.js +1 -1
- package/layout/free.js +1 -1
- package/layout/grid-new.js +1 -1
- package/layout/grid-switcher.js +1 -1
- package/layout/grid.js +1 -1
- package/layout/group.js +1 -1
- package/layout/header.js +1 -1
- package/layout/horizontal-scroller.js +1 -1
- package/layout/image-old.js +1 -1
- package/layout/image.js +1 -1
- package/layout/index.js +24 -2
- package/layout/label.js +1 -1
- package/layout/link.js +1 -1
- package/layout/list-OLD.js +1 -1
- package/layout/list.js +1 -1
- package/layout/meta-adder.js +1 -1
- package/layout/modal-2025.js +1 -1
- package/layout/modernwrap.js +1 -1
- package/layout/multiswitcher.js +1 -1
- package/layout/multiswitcherBeta.js +1 -1
- package/layout/nav-bar.js +1 -1
- package/layout/nav-factor/custom-div.js +1 -1
- package/layout/navBar-OLD.js +1 -1
- package/layout/new-flat-adder.js +1 -1
- package/layout/new-nav-bar.js +1 -1
- package/layout/offset-container.js +1 -1
- package/layout/polygon.js +1 -1
- package/layout/prerender-site.js +1 -1
- package/layout/prerender.js +1 -1
- package/layout/progress.js +1 -1
- package/layout/row.js +1 -1
- package/layout/saved-new-nav-bar.js +1 -1
- package/layout/scroll-video.js +1 -1
- package/layout/side-bar.js +1 -1
- package/layout/side-nav-bar.js +1 -1
- package/layout/simple-bar.js +1 -1
- package/layout/slider-2025.js +1 -1
- package/layout/spacer.js +1 -1
- package/layout/stack.js +1 -1
- package/layout/styler.js +1 -1
- package/layout/svg.js +1 -1
- package/layout/switcher.js +1 -1
- package/layout/table.js +1 -1
- package/layout/text-field.js +1 -1
- package/layout/text.js +1 -1
- package/layout/ulist.js +1 -1
- package/layout/video.js +1 -1
- package/layout/without-new.js +1 -1
- package/layout/wrap.js +1 -1
- package/layout/zoom-card.js +1 -1
- package/lib/card-getter.js +1 -1
- package/lib/data.js +27 -24
- package/lib/designer.js +1 -1
- package/lib/element-mapper.js +1 -1
- package/lib/keyframe-animation.js +1 -1
- package/lib/link-getter.js +1 -1
- package/lib/scroll-video.js +1 -1
- package/lib/seo.js +1 -1
- package/lib/stacker.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/transform-anim.js +1 -1
- package/package.json +1 -1
package/layout/side-bar.js
CHANGED
package/layout/side-nav-bar.js
CHANGED
package/layout/simple-bar.js
CHANGED
package/layout/slider-2025.js
CHANGED
package/layout/spacer.js
CHANGED
package/layout/stack.js
CHANGED
package/layout/styler.js
CHANGED
package/layout/svg.js
CHANGED
package/layout/switcher.js
CHANGED
package/layout/table.js
CHANGED
package/layout/text-field.js
CHANGED
package/layout/text.js
CHANGED
package/layout/ulist.js
CHANGED
package/layout/video.js
CHANGED
package/layout/without-new.js
CHANGED
package/layout/wrap.js
CHANGED
package/layout/zoom-card.js
CHANGED
package/lib/card-getter.js
CHANGED
package/lib/data.js
CHANGED
|
@@ -1,36 +1,39 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* nodality v1.0.
|
|
2
|
+
* nodality v1.0.171
|
|
3
3
|
* (c) 2026 Filip Vabrousek
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
const IS_NODE = typeof process !== "undefined" && !!process.versions?.node;
|
|
8
8
|
|
|
9
|
+
// `nodeImport` is a Function-constructor dynamic import that webpack
|
|
10
|
+
// CAN'T statically analyse — neither nodality's own webpack build nor
|
|
11
|
+
// any consumer's webpack tries to resolve "node:fs" / "node:path" at
|
|
12
|
+
// bundle time. The string flows through `new Function`, which is an
|
|
13
|
+
// indirection webpack treats as runtime-only. `webpackIgnore` alone
|
|
14
|
+
// wasn't enough: the comment is dropped during nodality's bundle and
|
|
15
|
+
// consumer bundlers re-scan the produced code without it. (Browsers
|
|
16
|
+
// never reach this code because of the IS_NODE guard below.)
|
|
17
|
+
const nodeImport = typeof Function !== "undefined"
|
|
18
|
+
? new Function("s", "return import(s)")
|
|
19
|
+
: null;
|
|
20
|
+
|
|
9
21
|
export async function loadJson(name, { fallback = undefined } = {}) {
|
|
10
22
|
try {
|
|
11
|
-
if (IS_NODE) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
//
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
for (const rel of [path.join("upload", name), name]) {
|
|
26
|
-
const abs = path.resolve(cwd, rel);
|
|
27
|
-
if (fs.existsSync(abs)) {
|
|
28
|
-
return { default: JSON.parse(fs.readFileSync(abs, "utf8")) };
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
throw new Error(`loadJson: ${name} not found (tried ./upload/${name} and ./${name})`);
|
|
32
|
-
});
|
|
33
|
-
return mod.default ?? mod;
|
|
23
|
+
if (IS_NODE && nodeImport) {
|
|
24
|
+
const fs = await nodeImport("node:fs");
|
|
25
|
+
const path = await nodeImport("node:path");
|
|
26
|
+
const cwd = process.cwd();
|
|
27
|
+
// Look for the file under `upload/` first (the canonical
|
|
28
|
+
// create-nodality layout), then plain `<name>` at project
|
|
29
|
+
// root as a fallback for non-conventional projects.
|
|
30
|
+
for (const rel of [path.join("upload", name), name]) {
|
|
31
|
+
const abs = path.resolve(cwd, rel);
|
|
32
|
+
if (fs.existsSync(abs)) {
|
|
33
|
+
return JSON.parse(fs.readFileSync(abs, "utf8"));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
throw new Error(`loadJson: ${name} not found (tried ./upload/${name} and ./${name})`);
|
|
34
37
|
}
|
|
35
38
|
const res = await fetch(`./${name}`);
|
|
36
39
|
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
package/lib/designer.js
CHANGED
package/lib/element-mapper.js
CHANGED
package/lib/link-getter.js
CHANGED
package/lib/scroll-video.js
CHANGED
package/lib/seo.js
CHANGED
package/lib/stacker.js
CHANGED
package/lib/theme.js
CHANGED
package/lib/transform-anim.js
CHANGED