@plenary/react 0.2.2 → 0.2.3
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/registry.js +6 -1
- package/dist/registry.js.map +1 -1
- package/package.json +3 -3
package/dist/registry.js
CHANGED
|
@@ -172,7 +172,7 @@ class Registry {
|
|
|
172
172
|
return this.all().map(({ registration: r }) => ({
|
|
173
173
|
name: r.key,
|
|
174
174
|
label: r.label,
|
|
175
|
-
icon: r.icon,
|
|
175
|
+
icon: iconUrl(r.icon),
|
|
176
176
|
props: r.props ?? [],
|
|
177
177
|
slots: r.slots ?? [],
|
|
178
178
|
category: r.category,
|
|
@@ -180,6 +180,11 @@ class Registry {
|
|
|
180
180
|
}));
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
|
+
function iconUrl(icon) {
|
|
184
|
+
const trimmed = icon?.trim();
|
|
185
|
+
if (!trimmed) return void 0;
|
|
186
|
+
return trimmed.startsWith("<svg") ? `data:image/svg+xml,${encodeURIComponent(trimmed)}` : trimmed;
|
|
187
|
+
}
|
|
183
188
|
const registry = new Registry();
|
|
184
189
|
function register(component, registration) {
|
|
185
190
|
return registry.register(component, registration);
|
package/dist/registry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/registry.ts"],"sourcesContent":["import type {\n ComponentRegistration,\n ManifestComponent,\n ThemeRegistration,\n} from \"@plenary/core\";\nimport type { PlenaryComponent, RegisteredComponent } from \"./types.js\";\nimport { Box } from \"./components/Box.js\";\nimport { Section } from \"./components/Section.js\";\nimport { Text } from \"./components/Text.js\";\nimport { Image } from \"./components/Image.js\";\nimport { Video } from \"./components/Video.js\";\n\n/** The built-in primitives, pre-registered so they behave like any custom component. */\nconst BUILTINS: {\n component: PlenaryComponent;\n registration: ComponentRegistration;\n}[] = [\n {\n component: Box,\n registration: {\n key: \"box\",\n label: \"Box\",\n category: \"Layout\",\n props: [{ key: \"className\", type: \"text\" }],\n slots: [{ name: \"children\", label: \"Content\" }],\n styles: [\"layout\", \"size\", \"background\", \"css\"],\n },\n },\n {\n component: Section,\n registration: {\n key: \"section\",\n label: \"Section\",\n category: \"Layout\",\n // Column slots (\"0\"…\"n-1\") are dynamic, driven by `columns`, and managed\n // by the built-in — so they are not declared statically here.\n props: [\n { key: \"columns\", type: \"number\", defaultValue: 1 },\n { key: \"gap\", type: \"number\", defaultValue: 16 },\n { key: \"className\", type: \"text\" },\n ],\n styles: [\"size\", \"background\", \"css\"],\n },\n },\n {\n component: Text,\n registration: {\n key: \"text\",\n label: \"Text\",\n category: \"Content\",\n props: [\n { key: \"content\", type: \"rich_text\" },\n {\n key: \"as\",\n type: \"select\",\n defaultValue: \"p\",\n // Options use the server's select field-settings shape ({value,label})\n // so the console's select input can drive them directly.\n settings: {\n options: [\n { value: \"p\", label: \"Paragraph\" },\n { value: \"h1\", label: \"Heading 1\" },\n { value: \"h2\", label: \"Heading 2\" },\n { value: \"h3\", label: \"Heading 3\" },\n { value: \"h4\", label: \"Heading 4\" },\n { value: \"h5\", label: \"Heading 5\" },\n { value: \"h6\", label: \"Heading 6\" },\n { value: \"span\", label: \"Span\" },\n { value: \"code\", label: \"Code\" },\n ],\n },\n },\n ],\n styles: [\"size\", \"typography\", \"css\"],\n },\n },\n {\n component: Image,\n registration: {\n key: \"image\",\n label: \"Image\",\n category: \"Content\",\n props: [\n // Alt is a block prop (below), so the media picker shows only the\n // asset itself — not its own alt/caption sub-fields.\n { key: \"media\", type: \"image\", ui: { show_alt_caption: false } },\n { key: \"alt\", type: \"text\", ui: { label: \"Alt Text\" } },\n // A one-off variant spec for this placement. The server enqueues the\n // matching variant on save and hydrates `media.variant_url` on read;\n // with no dimensions set, the original renders. Labels say \"output\"\n // (pixels served) to keep these apart from the Styles tab's layout Size.\n { key: \"width\", type: \"number\", ui: { label: \"Max Width (px)\" } },\n { key: \"height\", type: \"number\", ui: { label: \"Max Height (px)\" } },\n { key: \"quality\", type: \"number\", ui: { label: \"Quality (%)\" } },\n { key: \"crop\", type: \"boolean\", ui: { label: \"Crop to fill\" } },\n ],\n styles: [\"size\", \"css\"],\n },\n },\n {\n component: Video,\n registration: {\n key: \"video\",\n label: \"Video\",\n category: \"Content\",\n props: [\n // The source file is served as uploaded — no transcoding — so the\n // picker pins to the library's video type. Alt/caption sub-fields are\n // hidden like the Image block's: the player has no use for them.\n {\n key: \"media\",\n type: \"file\",\n ui: { label: \"Video\", media_type: \"video\", show_alt_caption: false },\n },\n {\n key: \"poster\",\n type: \"image\",\n ui: { label: \"Poster Image\", show_alt_caption: false },\n },\n { key: \"controls\", type: \"boolean\", defaultValue: true },\n {\n key: \"autoplay\",\n type: \"boolean\",\n ui: { label: \"Autoplay (browsers require Muted)\" },\n },\n { key: \"loop\", type: \"boolean\" },\n { key: \"muted\", type: \"boolean\" },\n {\n key: \"playsinline\",\n type: \"boolean\",\n defaultValue: true,\n ui: { label: \"Plays Inline\" },\n },\n {\n key: \"preload\",\n type: \"select\",\n defaultValue: \"metadata\",\n settings: {\n options: [\n { value: \"none\", label: \"None\" },\n { value: \"metadata\", label: \"Metadata\" },\n { value: \"auto\", label: \"Auto\" },\n ],\n },\n },\n ],\n styles: [\"size\", \"css\"],\n },\n },\n];\n\n/**\n * The module-singleton component registry. Because it is a shared module, both\n * the render path (SSR + client) and the preview bridge see the same\n * registrations — the site's registry file is imported wherever either is used.\n */\nexport class Registry {\n private components = new Map<string, RegisteredComponent>();\n private theme: ThemeRegistration | undefined;\n\n constructor() {\n for (const b of BUILTINS) this.register(b.component, b.registration);\n }\n\n /** Register a component (built-in or custom) under its registration key. */\n register(\n component: PlenaryComponent,\n registration: ComponentRegistration,\n ): this {\n this.components.set(registration.key, { component, registration });\n return this;\n }\n\n /**\n * Declare the site's design tokens. Each token mirrors a CSS custom property\n * the site's stylesheet defines (`--<name>`); the editor stores references\n * (`var(--<name>)`), so the tokens must actually exist in the site's CSS for\n * styled pages to render.\n */\n registerTheme(theme: ThemeRegistration): this {\n this.theme = theme;\n return this;\n }\n\n getTheme(): ThemeRegistration | undefined {\n return this.theme;\n }\n\n get(key: string): RegisteredComponent | undefined {\n return this.components.get(key);\n }\n\n all(): RegisteredComponent[] {\n return [...this.components.values()];\n }\n\n /** The full component manifest announced to the console over the bridge. */\n manifest(): ManifestComponent[] {\n return this.all().map(({ registration: r }) => ({\n name: r.key,\n label: r.label,\n icon: r.icon,\n props: r.props ?? [],\n slots: r.slots ?? [],\n category: r.category,\n styles: r.styles,\n }));\n }\n}\n\nexport const registry = new Registry();\n\n/** Register a component so the dom tree may reference it by key. */\nexport function register(\n component: PlenaryComponent,\n registration: ComponentRegistration,\n): Registry {\n return registry.register(component, registration);\n}\n\n/** Declare the site's design tokens (see Registry.registerTheme). */\nexport function registerTheme(theme: ThemeRegistration): Registry {\n return registry.registerTheme(theme);\n}\n\n/** Namespace mirroring the design brief's `Plenary.register(...)` surface. */\nexport const Plenary = { register, registerTheme };\n\n/** The manifest of every registered component (built-ins + custom). */\nexport function getManifest(): ManifestComponent[] {\n return registry.manifest();\n}\n\n/** The site's registered design tokens, if any. */\nexport function getTheme(): ThemeRegistration | undefined {\n return registry.getTheme();\n}\n"],"mappings":"AAMA,SAAS,WAAW;AACpB,SAAS,eAAe;AACxB,SAAS,YAAY;AACrB,SAAS,aAAa;AACtB,SAAS,aAAa;AAGtB,MAAM,WAGA;AAAA,EACJ;AAAA,IACE,WAAW;AAAA,IACX,cAAc;AAAA,MACZ,KAAK;AAAA,MACL,OAAO;AAAA,MACP,UAAU;AAAA,MACV,OAAO,CAAC,EAAE,KAAK,aAAa,MAAM,OAAO,CAAC;AAAA,MAC1C,OAAO,CAAC,EAAE,MAAM,YAAY,OAAO,UAAU,CAAC;AAAA,MAC9C,QAAQ,CAAC,UAAU,QAAQ,cAAc,KAAK;AAAA,IAChD;AAAA,EACF;AAAA,EACA;AAAA,IACE,WAAW;AAAA,IACX,cAAc;AAAA,MACZ,KAAK;AAAA,MACL,OAAO;AAAA,MACP,UAAU;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AAY;AAClD;AAGO,SAAS,cAAc,OAAoC;AAChE,SAAO,SAAS,cAAc,KAAK;AACrC;AAGO,MAAM,UAAU,EAAE,UAAU,cAAc;AAG1C,SAAS,cAAmC;AACjD,SAAO,SAAS,SAAS;AAC3B;AAGO,SAAS,WAA0C;AACxD,SAAO,SAAS,SAAS;AAC3B;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/registry.ts"],"sourcesContent":["import type {\n ComponentRegistration,\n ManifestComponent,\n ThemeRegistration,\n} from \"@plenary/core\";\nimport type { PlenaryComponent, RegisteredComponent } from \"./types.js\";\nimport { Box } from \"./components/Box.js\";\nimport { Section } from \"./components/Section.js\";\nimport { Text } from \"./components/Text.js\";\nimport { Image } from \"./components/Image.js\";\nimport { Video } from \"./components/Video.js\";\n\n/** The built-in primitives, pre-registered so they behave like any custom component. */\nconst BUILTINS: {\n component: PlenaryComponent;\n registration: ComponentRegistration;\n}[] = [\n {\n component: Box,\n registration: {\n key: \"box\",\n label: \"Box\",\n category: \"Layout\",\n props: [{ key: \"className\", type: \"text\" }],\n slots: [{ name: \"children\", label: \"Content\" }],\n styles: [\"layout\", \"size\", \"background\", \"css\"],\n },\n },\n {\n component: Section,\n registration: {\n key: \"section\",\n label: \"Section\",\n category: \"Layout\",\n // Column slots (\"0\"…\"n-1\") are dynamic, driven by `columns`, and managed\n // by the built-in — so they are not declared statically here.\n props: [\n { key: \"columns\", type: \"number\", defaultValue: 1 },\n { key: \"gap\", type: \"number\", defaultValue: 16 },\n { key: \"className\", type: \"text\" },\n ],\n styles: [\"size\", \"background\", \"css\"],\n },\n },\n {\n component: Text,\n registration: {\n key: \"text\",\n label: \"Text\",\n category: \"Content\",\n props: [\n { key: \"content\", type: \"rich_text\" },\n {\n key: \"as\",\n type: \"select\",\n defaultValue: \"p\",\n // Options use the server's select field-settings shape ({value,label})\n // so the console's select input can drive them directly.\n settings: {\n options: [\n { value: \"p\", label: \"Paragraph\" },\n { value: \"h1\", label: \"Heading 1\" },\n { value: \"h2\", label: \"Heading 2\" },\n { value: \"h3\", label: \"Heading 3\" },\n { value: \"h4\", label: \"Heading 4\" },\n { value: \"h5\", label: \"Heading 5\" },\n { value: \"h6\", label: \"Heading 6\" },\n { value: \"span\", label: \"Span\" },\n { value: \"code\", label: \"Code\" },\n ],\n },\n },\n ],\n styles: [\"size\", \"typography\", \"css\"],\n },\n },\n {\n component: Image,\n registration: {\n key: \"image\",\n label: \"Image\",\n category: \"Content\",\n props: [\n // Alt is a block prop (below), so the media picker shows only the\n // asset itself — not its own alt/caption sub-fields.\n { key: \"media\", type: \"image\", ui: { show_alt_caption: false } },\n { key: \"alt\", type: \"text\", ui: { label: \"Alt Text\" } },\n // A one-off variant spec for this placement. The server enqueues the\n // matching variant on save and hydrates `media.variant_url` on read;\n // with no dimensions set, the original renders. Labels say \"output\"\n // (pixels served) to keep these apart from the Styles tab's layout Size.\n { key: \"width\", type: \"number\", ui: { label: \"Max Width (px)\" } },\n { key: \"height\", type: \"number\", ui: { label: \"Max Height (px)\" } },\n { key: \"quality\", type: \"number\", ui: { label: \"Quality (%)\" } },\n { key: \"crop\", type: \"boolean\", ui: { label: \"Crop to fill\" } },\n ],\n styles: [\"size\", \"css\"],\n },\n },\n {\n component: Video,\n registration: {\n key: \"video\",\n label: \"Video\",\n category: \"Content\",\n props: [\n // The source file is served as uploaded — no transcoding — so the\n // picker pins to the library's video type. Alt/caption sub-fields are\n // hidden like the Image block's: the player has no use for them.\n {\n key: \"media\",\n type: \"file\",\n ui: { label: \"Video\", media_type: \"video\", show_alt_caption: false },\n },\n {\n key: \"poster\",\n type: \"image\",\n ui: { label: \"Poster Image\", show_alt_caption: false },\n },\n { key: \"controls\", type: \"boolean\", defaultValue: true },\n {\n key: \"autoplay\",\n type: \"boolean\",\n ui: { label: \"Autoplay (browsers require Muted)\" },\n },\n { key: \"loop\", type: \"boolean\" },\n { key: \"muted\", type: \"boolean\" },\n {\n key: \"playsinline\",\n type: \"boolean\",\n defaultValue: true,\n ui: { label: \"Plays Inline\" },\n },\n {\n key: \"preload\",\n type: \"select\",\n defaultValue: \"metadata\",\n settings: {\n options: [\n { value: \"none\", label: \"None\" },\n { value: \"metadata\", label: \"Metadata\" },\n { value: \"auto\", label: \"Auto\" },\n ],\n },\n },\n ],\n styles: [\"size\", \"css\"],\n },\n },\n];\n\n/**\n * The module-singleton component registry. Because it is a shared module, both\n * the render path (SSR + client) and the preview bridge see the same\n * registrations — the site's registry file is imported wherever either is used.\n */\nexport class Registry {\n private components = new Map<string, RegisteredComponent>();\n private theme: ThemeRegistration | undefined;\n\n constructor() {\n for (const b of BUILTINS) this.register(b.component, b.registration);\n }\n\n /** Register a component (built-in or custom) under its registration key. */\n register(\n component: PlenaryComponent,\n registration: ComponentRegistration,\n ): this {\n this.components.set(registration.key, { component, registration });\n return this;\n }\n\n /**\n * Declare the site's design tokens. Each token mirrors a CSS custom property\n * the site's stylesheet defines (`--<name>`); the editor stores references\n * (`var(--<name>)`), so the tokens must actually exist in the site's CSS for\n * styled pages to render.\n */\n registerTheme(theme: ThemeRegistration): this {\n this.theme = theme;\n return this;\n }\n\n getTheme(): ThemeRegistration | undefined {\n return this.theme;\n }\n\n get(key: string): RegisteredComponent | undefined {\n return this.components.get(key);\n }\n\n all(): RegisteredComponent[] {\n return [...this.components.values()];\n }\n\n /** The full component manifest announced to the console over the bridge. */\n manifest(): ManifestComponent[] {\n return this.all().map(({ registration: r }) => ({\n name: r.key,\n label: r.label,\n icon: iconUrl(r.icon),\n props: r.props ?? [],\n slots: r.slots ?? [],\n category: r.category,\n styles: r.styles,\n }));\n }\n}\n\n/**\n * The manifest carries icons as something an `<img>` can load: URLs and data\n * URIs pass through, inline SVG markup is wrapped in a data URI.\n */\nfunction iconUrl(icon: string | undefined): string | undefined {\n const trimmed = icon?.trim();\n if (!trimmed) return undefined;\n return trimmed.startsWith(\"<svg\")\n ? `data:image/svg+xml,${encodeURIComponent(trimmed)}`\n : trimmed;\n}\n\nexport const registry = new Registry();\n\n/** Register a component so the dom tree may reference it by key. */\nexport function register(\n component: PlenaryComponent,\n registration: ComponentRegistration,\n): Registry {\n return registry.register(component, registration);\n}\n\n/** Declare the site's design tokens (see Registry.registerTheme). */\nexport function registerTheme(theme: ThemeRegistration): Registry {\n return registry.registerTheme(theme);\n}\n\n/** Namespace mirroring the design brief's `Plenary.register(...)` surface. */\nexport const Plenary = { register, registerTheme };\n\n/** The manifest of every registered component (built-ins + custom). */\nexport function getManifest(): ManifestComponent[] {\n return registry.manifest();\n}\n\n/** The site's registered design tokens, if any. */\nexport function getTheme(): ThemeRegistration | undefined {\n return registry.getTheme();\n}\n"],"mappings":"AAMA,SAAS,WAAW;AACpB,SAAS,eAAe;AACxB,SAAS,YAAY;AACrB,SAAS,aAAa;AACtB,SAAS,aAAa;AAGtB,MAAM,WAGA;AAAA,EACJ;AAAA,IACE,WAAW;AAAA,IACX,cAAc;AAAA,MACZ,KAAK;AAAA,MACL,OAAO;AAAA,MACP,UAAU;AAAA,MACV,OAAO,CAAC,EAAE,KAAK,aAAa,MAAM,OAAO,CAAC;AAAA,MAC1C,OAAO,CAAC,EAAE,MAAM,YAAY,OAAO,UAAU,CAAC;AAAA,MAC9C,QAAQ,CAAC,UAAU,QAAQ,cAAc,KAAK;AAAA,IAChD;AAAA,EACF;AAAA,EACA;AAAA,IACE,WAAW;AAAA,IACX,cAAc;AAAA,MACZ,KAAK;AAAA,MACL,OAAO;AAAA,MACP,UAAU;AAAA;AAAA;AAAA,MAGV,OAAO;AAAA,QACL,EAAE,KAAK,WAAW,MAAM,UAAU,cAAc,EAAE;AAAA,QAClD,EAAE,KAAK,OAAO,MAAM,UAAU,cAAc,GAAG;AAAA,QAC/C,EAAE,KAAK,aAAa,MAAM,OAAO;AAAA,MACnC;AAAA,MACA,QAAQ,CAAC,QAAQ,cAAc,KAAK;AAAA,IACtC;AAAA,EACF;AAAA,EACA;AAAA,IACE,WAAW;AAAA,IACX,cAAc;AAAA,MACZ,KAAK;AAAA,MACL,OAAO;A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B;AAGO,SAAS,WAA0C;AACxD,SAAO,SAAS,SAAS;AAC3B;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plenary/react",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Plenary React renderer, component registry, built-in components, and preview bridge.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"dist"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@plenary/client": "0.2.
|
|
24
|
-
"@plenary/core": "0.2.
|
|
23
|
+
"@plenary/client": "0.2.3",
|
|
24
|
+
"@plenary/core": "0.2.3"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": "^18 || ^19",
|