nodality 1.0.168 → 1.0.170
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 +18 -23
- 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
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* nodality/data — runtime/SSG-aware data loader
|
|
3
|
+
*
|
|
4
|
+
* `loadJson(name, opts?)` resolves JSON in whichever environment the
|
|
5
|
+
* page entry is currently executing:
|
|
6
|
+
*
|
|
7
|
+
* • Browser → relative `fetch("./<name>")` from the page's URL.
|
|
8
|
+
* • Node → ESM JSON import from `../<name>` relative to this
|
|
9
|
+
* module (i.e. from the project's `upload/` directory).
|
|
10
|
+
*
|
|
11
|
+
* The two paths differ because under SSG (nodality prerender + jsdom)
|
|
12
|
+
* there is no dev server to fetch from — fetches silently fail and
|
|
13
|
+
* the page ships an empty mount. The ESM import path reads the JSON
|
|
14
|
+
* straight off disk, embedding the data into the prerendered HTML so
|
|
15
|
+
* crawlers see real content.
|
|
16
|
+
*
|
|
17
|
+
* Usage in a page entry:
|
|
18
|
+
*
|
|
19
|
+
* import { loadJson } from "nodality/data";
|
|
20
|
+
* const products = await loadJson("products.json");
|
|
21
|
+
*
|
|
22
|
+
* Conventions:
|
|
23
|
+
* • At runtime the file must live next to the page HTML (so
|
|
24
|
+
* `./products.json` resolves under the deployed origin).
|
|
25
|
+
* • At build time the file must live in `upload/` (the project's
|
|
26
|
+
* `uploadDir`) — which is the same place. Single source of truth.
|
|
27
|
+
*
|
|
28
|
+
* `fallback` is an opt-in escape hatch: pass `{ fallback: [] }` to
|
|
29
|
+
* return the supplied value instead of throwing when the file is
|
|
30
|
+
* missing. Useful for "team.json doesn't exist yet" stub pages.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
/*!
|
|
34
|
+
* nodality/seo — SEO metadata helpers
|
|
35
|
+
*
|
|
36
|
+
* Exposes a single `applySeoMeta()` call that idempotently writes a
|
|
37
|
+
* full per-page metadata bundle into <head>: description, canonical,
|
|
38
|
+
* Open Graph (Facebook / iMessage / WhatsApp / Slack / LinkedIn),
|
|
39
|
+
* Twitter / X card, and an optional schema.org JSON-LD payload.
|
|
40
|
+
*
|
|
41
|
+
* Also exports a handful of pre-built JSON-LD builders for the
|
|
42
|
+
* common schema types (Organization, WebSite, Product, Article,
|
|
43
|
+
* BreadcrumbList) so projects don't have to memorise the schema.org
|
|
44
|
+
* field names.
|
|
45
|
+
*
|
|
46
|
+
* Works in both directions:
|
|
47
|
+
* • At SSG time (nodality prerender) the tags land in the static
|
|
48
|
+
* HTML response — crawlers and social-card scrapers index them.
|
|
49
|
+
* • At browser hydration time the same call re-applies the tags
|
|
50
|
+
* against the live <head>; idempotent via `data-seo="1"` markers,
|
|
51
|
+
* so re-rendering the page doesn't pile up duplicates.
|
|
52
|
+
*
|
|
53
|
+
* Origin handling: pass `path` as a leading-slash route ("/" or
|
|
54
|
+
* "/blog/post-1") and configure the origin globally via
|
|
55
|
+
* `setSeoOrigin("https://example.com")` once at app boot. Falls back
|
|
56
|
+
* to `window.location.origin` in the browser if no origin is set;
|
|
57
|
+
* falls back to "" under SSG (canonical-relative).
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
package/layout/animator.js
CHANGED
package/layout/audio.js
CHANGED
package/layout/audionew.js
CHANGED
package/layout/base-2.js
CHANGED
package/layout/base.js
CHANGED
package/layout/box.js
CHANGED
package/layout/button.js
CHANGED
package/layout/cards.js
CHANGED
package/layout/center.js
CHANGED
package/layout/checkbox.js
CHANGED
package/layout/circle.js
CHANGED
package/layout/clean-row.js
CHANGED
package/layout/code.js
CHANGED
package/layout/container.js
CHANGED
package/layout/custom.js
CHANGED
package/layout/div-image.js
CHANGED
package/layout/dropdown-2025.js
CHANGED
package/layout/dropdown.js
CHANGED
package/layout/empty-element.js
CHANGED
package/layout/flex-card.js
CHANGED
package/layout/flex-grid.js
CHANGED
package/layout/flex-row.js
CHANGED
package/layout/footer.js
CHANGED
package/layout/free.js
CHANGED
package/layout/grid-new.js
CHANGED
package/layout/grid-switcher.js
CHANGED
package/layout/grid.js
CHANGED
package/layout/group.js
CHANGED
package/layout/header.js
CHANGED
package/layout/image-old.js
CHANGED
package/layout/image.js
CHANGED
package/layout/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* nodality v1.0.
|
|
2
|
+
* nodality v1.0.170
|
|
3
3
|
* (c) 2026 Filip Vabrousek
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -70,6 +70,19 @@ import { AreaSwitcher } from "../layout/grid-switcher.js";
|
|
|
70
70
|
import { Polygon } from "../layout/polygon.js";
|
|
71
71
|
import { Circle } from "../layout/circle.js";
|
|
72
72
|
|
|
73
|
+
// SEO + data helpers — also surface via package.json subpath exports
|
|
74
|
+
// (`nodality/seo`, `nodality/data`) for Node-side tree-shaking, but we
|
|
75
|
+
// re-export from the main entry so browsers reach them through the
|
|
76
|
+
// SAME `import { applySeoMeta } from "nodality"` line that the
|
|
77
|
+
// importmap already resolves. Without this, browser-side use of the
|
|
78
|
+
// subpath form throws "Failed to resolve module specifier
|
|
79
|
+
// 'nodality/seo'" because no importmap entry maps it.
|
|
80
|
+
import {
|
|
81
|
+
applySeoMeta, setSeoOrigin,
|
|
82
|
+
websiteJsonLd, organizationJsonLd, productJsonLd, articleJsonLd, breadcrumbJsonLd,
|
|
83
|
+
} from "../lib/seo.js";
|
|
84
|
+
import { loadJson } from "../lib/data.js";
|
|
85
|
+
|
|
73
86
|
// Expose modules as globals
|
|
74
87
|
if (typeof window !== 'undefined') {
|
|
75
88
|
window.ElementMapper = ElementMapper;
|
|
@@ -248,5 +261,14 @@ export {
|
|
|
248
261
|
Polygon,
|
|
249
262
|
Circle,
|
|
250
263
|
FloatingInput,
|
|
251
|
-
Form
|
|
264
|
+
Form,
|
|
265
|
+
// SEO + data helpers — see explanation above the imports block.
|
|
266
|
+
applySeoMeta,
|
|
267
|
+
setSeoOrigin,
|
|
268
|
+
websiteJsonLd,
|
|
269
|
+
organizationJsonLd,
|
|
270
|
+
productJsonLd,
|
|
271
|
+
articleJsonLd,
|
|
272
|
+
breadcrumbJsonLd,
|
|
273
|
+
loadJson,
|
|
252
274
|
}; // 172112 Nice!!!! 17/04/25
|
package/layout/label.js
CHANGED
package/layout/link.js
CHANGED
package/layout/list-OLD.js
CHANGED
package/layout/list.js
CHANGED
package/layout/meta-adder.js
CHANGED
package/layout/modal-2025.js
CHANGED
package/layout/modernwrap.js
CHANGED
package/layout/multiswitcher.js
CHANGED
package/layout/nav-bar.js
CHANGED
package/layout/navBar-OLD.js
CHANGED
package/layout/new-flat-adder.js
CHANGED
package/layout/new-nav-bar.js
CHANGED
package/layout/polygon.js
CHANGED
package/layout/prerender-site.js
CHANGED
package/layout/prerender.js
CHANGED
package/layout/progress.js
CHANGED
package/layout/row.js
CHANGED
package/layout/scroll-video.js
CHANGED