@palmyit/elements 0.1.7 → 0.1.19

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.
Files changed (98) hide show
  1. package/README.md +2 -0
  2. package/dist/definitions.d.ts +34 -25
  3. package/dist/definitions.js +1681 -868
  4. package/dist/elements/article/definition.d.ts +43 -0
  5. package/dist/elements/article/template.d.ts +12 -0
  6. package/dist/elements/button/definition.d.ts +39 -0
  7. package/dist/elements/button/template.d.ts +2 -0
  8. package/dist/elements/checkbox/definition.d.ts +10 -0
  9. package/dist/elements/checkbox/template.d.ts +2 -0
  10. package/dist/elements/container/definition.d.ts +39 -0
  11. package/dist/elements/container/template.d.ts +2 -0
  12. package/dist/elements/divider/definition.d.ts +10 -0
  13. package/dist/elements/divider/template.d.ts +2 -0
  14. package/dist/elements/footer/definition.d.ts +35 -0
  15. package/dist/elements/footer/template.d.ts +2 -0
  16. package/dist/elements/heading/definition.d.ts +29 -0
  17. package/dist/elements/heading/template.d.ts +2 -0
  18. package/dist/elements/icon/definition.d.ts +29 -0
  19. package/dist/elements/icon/template.d.ts +2 -0
  20. package/dist/elements/image/definition.d.ts +80 -0
  21. package/dist/elements/image/template.d.ts +32 -0
  22. package/dist/elements/list/definition.d.ts +13 -0
  23. package/dist/elements/list/template.d.ts +2 -0
  24. package/dist/elements/nav/definition.d.ts +39 -0
  25. package/dist/elements/nav/template.d.ts +17 -0
  26. package/dist/elements/page/definition.d.ts +62 -0
  27. package/dist/elements/page/template.d.ts +2 -0
  28. package/dist/elements/radio/definition.d.ts +13 -0
  29. package/dist/elements/radio/template.d.ts +2 -0
  30. package/dist/elements/rich-text/definition.d.ts +8 -0
  31. package/dist/elements/rich-text/template.d.ts +2 -0
  32. package/dist/elements/section/definition.d.ts +39 -0
  33. package/dist/elements/section/template.d.ts +2 -0
  34. package/dist/elements/select/definition.d.ts +13 -0
  35. package/dist/elements/select/template.d.ts +2 -0
  36. package/dist/{schema/PTable/pTable.definition.d.ts → elements/table/definition.d.ts} +4 -2
  37. package/dist/elements/table/template.d.ts +2 -0
  38. package/dist/{schema/PText/pText.definition.d.ts → elements/text/definition.d.ts} +11 -10
  39. package/dist/elements/text/template.d.ts +2 -0
  40. package/dist/elements/text-area/definition.d.ts +10 -0
  41. package/dist/elements/text-area/template.d.ts +2 -0
  42. package/dist/elements/text-field/definition.d.ts +10 -0
  43. package/dist/elements/text-field/template.d.ts +2 -0
  44. package/dist/elements/video/definition.d.ts +49 -0
  45. package/dist/elements/video/template.d.ts +8 -0
  46. package/dist/elements/video/youtube.d.ts +4 -0
  47. package/dist/manifest.json +2 -2
  48. package/dist/plmt-elements.css +2 -1
  49. package/dist/render/renderHtml.d.ts +1 -1
  50. package/dist/render/styleToClasses.d.ts +34 -0
  51. package/dist/render/styleToVars.d.ts +2 -0
  52. package/dist/render/styleTokens.d.ts +67 -0
  53. package/dist/render/tags.d.ts +9 -1
  54. package/dist/render/types.d.ts +10 -0
  55. package/dist/schema/Fields/BackgroundField/backgroundValue.d.ts +4 -3
  56. package/dist/schema/Fields/ColorField/colorText.d.ts +3 -0
  57. package/dist/schema/Fields/IconPicker/iconCatalog.d.ts +5 -1
  58. package/dist/schema/addressSchema.d.ts +2 -0
  59. package/dist/schema/backgroundStyleDefinitions.d.ts +1 -6
  60. package/dist/schema/device/devices.d.ts +8 -0
  61. package/dist/schema/deviceSettings.d.ts +1 -1
  62. package/dist/schema/elementCategories.d.ts +29 -0
  63. package/dist/schema/elementConfiguration.d.ts +1 -1
  64. package/dist/schema/elementRegistry.d.ts +38 -14
  65. package/dist/schema/elementStyleDefinitions.d.ts +7 -15
  66. package/dist/schema/elementTemplates.d.ts +3 -2
  67. package/dist/schema/linkSettings.d.ts +19 -2
  68. package/dist/schema/style/elementStyle.d.ts +3 -3
  69. package/dist/schema/style/page-styles.d.ts +2 -2
  70. package/dist/schema/styleItems.d.ts +18 -0
  71. package/dist/schema/styleTokensSchema.d.ts +290 -0
  72. package/dist/tags.json +5 -1
  73. package/dist/templates/brands/brandSpec.d.ts +5 -0
  74. package/dist/templates/elementSpec.d.ts +3 -8
  75. package/dist/templates/head.d.ts +43 -0
  76. package/dist/templates/helpers.d.ts +9 -1
  77. package/dist/templates/heroicons/heroiconSpec.d.ts +6 -0
  78. package/dist/templates.d.ts +6 -1
  79. package/dist/templates.js +1428 -234
  80. package/dist/youtube-BDsE1Bz3.js +910 -0
  81. package/package.json +5 -3
  82. package/dist/schema/PButton/pButton.definition.d.ts +0 -38
  83. package/dist/schema/PCheckbox/pCheckbox.definition.d.ts +0 -10
  84. package/dist/schema/PContainer/pContainer.definition.d.ts +0 -39
  85. package/dist/schema/PDivider/pDivider.definition.d.ts +0 -10
  86. package/dist/schema/PIcon/pIcon.definition.d.ts +0 -18
  87. package/dist/schema/PImage/pImage.definition.d.ts +0 -33
  88. package/dist/schema/PList/pList.definition.d.ts +0 -11
  89. package/dist/schema/PPage/pPage.definition.d.ts +0 -22
  90. package/dist/schema/PRadio/pRadio.definition.d.ts +0 -13
  91. package/dist/schema/PRichText/pRichText.definition.d.ts +0 -8
  92. package/dist/schema/PSection/pSection.definition.d.ts +0 -39
  93. package/dist/schema/PSelect/pSelect.definition.d.ts +0 -13
  94. package/dist/schema/PTextArea/pTextArea.definition.d.ts +0 -10
  95. package/dist/schema/PTextField/pTextField.definition.d.ts +0 -10
  96. package/dist/schema/PVideo/pVideo.definition.d.ts +0 -10
  97. /package/dist/{schema/PRichText → elements/rich-text}/richTextMarks.d.ts +0 -0
  98. /package/dist/{schema/PRichText → elements/rich-text}/richTextOptions.d.ts +0 -0
@@ -7,7 +7,7 @@ export type DeviceStyleOverrides<TStyle> = Partial<Record<OverrideProp, Partial<
7
7
  /**
8
8
  * Adds the Show for devices flags to an element, and, when it has `styles`,
9
9
  * portrait and landscape Tablet and Mobile overrides of those styles. Publish
10
- * writes only flags that change visibility and overrides that are set.
10
+ * writes a nested `devices` object with only the flags and overrides that differ.
11
11
  */
12
12
  export declare function withDeviceSettings<TProps>(configuration: ElementConfiguration<TProps>, styles?: StyleDefinition[]): ElementConfiguration<TProps & Partial<DeviceVisibility> & DeviceStyleOverrides<Record<string, unknown>>>;
13
13
  export {};
@@ -0,0 +1,29 @@
1
+ import { ElementType } from './elementConfiguration';
2
+ export type ElementCategory = {
3
+ id: string;
4
+ title: string;
5
+ components: readonly ElementType[];
6
+ };
7
+ /** Structural types kept out of the Elements drawer. */
8
+ export declare const hiddenFromDrawer: readonly ["PPage", "PSection"];
9
+ export declare const elementCategories: readonly [{
10
+ readonly id: "basic";
11
+ readonly title: "Basic";
12
+ readonly components: readonly ["PButton", "PText", "PHeading", "PRichText", "PImage", "PVideo", "PList", "PIcon", "PDivider"];
13
+ }, {
14
+ readonly id: "layout";
15
+ readonly title: "Layout";
16
+ readonly components: readonly ["PContainer", "PTable", "PArticle", "PNav", "PFooter"];
17
+ }, {
18
+ readonly id: "inputs";
19
+ readonly title: "Inputs";
20
+ readonly components: readonly ["PTextField", "PTextArea", "PCheckbox", "PRadio"];
21
+ }, {
22
+ readonly id: "dropdown";
23
+ readonly title: "Dropdown";
24
+ readonly components: readonly ["PSelect"];
25
+ }, {
26
+ readonly id: "feedback";
27
+ readonly title: "Feedback";
28
+ readonly components: readonly [];
29
+ }];
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { ElementTemplate } from './elementTemplates';
3
- export type ElementType = 'PPage' | 'PSection' | 'PContainer' | 'PButton' | 'PText' | 'PRichText' | 'PImage' | 'PVideo' | 'PList' | 'PIcon' | 'PDivider' | 'PTextField' | 'PTextArea' | 'PCheckbox' | 'PRadio' | 'PSelect' | 'PTable';
3
+ export type ElementType = 'PPage' | 'PSection' | 'PContainer' | 'PNav' | 'PFooter' | 'PButton' | 'PText' | 'PHeading' | 'PRichText' | 'PImage' | 'PVideo' | 'PList' | 'PIcon' | 'PDivider' | 'PTextField' | 'PTextArea' | 'PCheckbox' | 'PRadio' | 'PSelect' | 'PTable' | 'PArticle';
4
4
  export type DocumentAttributes = Record<string, unknown>;
5
5
  /**
6
6
  * The words the page history uses for an element. `summary` names one
@@ -1,40 +1,64 @@
1
1
  import { ElementType } from './elementConfiguration';
2
2
  export declare const elementRegistry: {
3
- PPage: import('./elementConfiguration').ElementConfiguration<import('./PPage/pPage.definition').PPageRootProps>;
3
+ PPage: import('./elementConfiguration').ElementConfiguration<import('../definitions').PPageRootProps>;
4
4
  PSection: import('./elementConfiguration').ElementConfiguration<import('./layoutElementConfiguration').LayoutElementProps & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
5
5
  PContainer: import('./elementConfiguration').ElementConfiguration<import('./layoutElementConfiguration').LayoutElementProps & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
6
+ PNav: import('./elementConfiguration').ElementConfiguration<import('../definitions').PNavDocumentProps>;
7
+ PFooter: import('./elementConfiguration').ElementConfiguration<import('../definitions').PFooterDocumentProps & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
6
8
  PButton: import('./elementConfiguration').ElementConfiguration<import('./linkSettings').LinkSettings & {
7
9
  id: string;
8
10
  name: string;
9
11
  startIcon: string;
10
12
  endIcon: string;
11
- style: import('./PButton/pButton.definition').ButtonStyle;
13
+ style: import('../definitions').ButtonStyle;
12
14
  } & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
13
15
  PText: import('./elementConfiguration').ElementConfiguration<import('./linkSettings').LinkSettings & {
14
16
  id: string;
15
17
  text: string;
16
- style: import('./PText/pText.definition').TextStyle;
18
+ style: import('../definitions').TextStyle;
17
19
  } & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
18
- PRichText: import('./elementConfiguration').ElementConfiguration<import('./PRichText/pRichText.definition').PRichTextDocumentProps & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
20
+ PHeading: import('./elementConfiguration').ElementConfiguration<import('./linkSettings').LinkSettings & {
21
+ id: string;
22
+ text: string;
23
+ level: import('../definitions').HeadingLevel;
24
+ anchor: string;
25
+ style: import('../definitions').TextStyle;
26
+ } & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
27
+ PRichText: import('./elementConfiguration').ElementConfiguration<import('../elements/rich-text/definition').PRichTextDocumentProps & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
19
28
  PImage: import('./elementConfiguration').ElementConfiguration<import('./linkSettings').LinkSettings & {
20
29
  id: string;
21
30
  src: string;
22
31
  alt: string;
23
- style: import('./PImage/pImage.definition').ImageStyle;
32
+ priority: boolean;
33
+ caption: string;
34
+ decorative: boolean;
35
+ intrinsicWidth: number | null;
36
+ intrinsicHeight: number | null;
37
+ tabletSrc: string;
38
+ mobileSrc: string;
39
+ aspectRatio: import('../definitions').ImageAspectRatio;
40
+ objectFit: import('../definitions').ImageObjectFit | "";
41
+ objectPosition: import('../definitions').ImageObjectPosition;
42
+ shadow: import('../definitions').ImageShadow;
43
+ captionAlign: import('../definitions').ImageCaptionAlign;
44
+ style: import('../definitions').ImageStyle;
24
45
  } & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
25
- PVideo: import('./elementConfiguration').ElementConfiguration<import('./PVideo/pVideo.definition').PVideoDocumentProps & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
26
- PList: import('./elementConfiguration').ElementConfiguration<import('./PList/pList.definition').PListDocumentProps & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
46
+ PVideo: import('./elementConfiguration').ElementConfiguration<import('../definitions').PVideoDocumentProps & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
47
+ PList: import('./elementConfiguration').ElementConfiguration<import('../elements/list/definition').PListDocumentProps & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
27
48
  PIcon: import('./elementConfiguration').ElementConfiguration<import('./linkSettings').LinkSettings & {
28
49
  id: string;
29
50
  icon: string;
30
51
  label: string;
52
+ size: import('../definitions').IconSize;
53
+ shape: import('../definitions').IconShape;
31
54
  } & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
32
- PDivider: import('./elementConfiguration').ElementConfiguration<import('./PDivider/pDivider.definition').PDividerDocumentProps & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
33
- PTextField: import('./elementConfiguration').ElementConfiguration<import('./PTextField/pTextField.definition').PTextFieldDocumentProps & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
34
- PTextArea: import('./elementConfiguration').ElementConfiguration<import('./PTextArea/pTextArea.definition').PTextAreaDocumentProps & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
35
- PCheckbox: import('./elementConfiguration').ElementConfiguration<import('./PCheckbox/pCheckbox.definition').PCheckboxDocumentProps & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
36
- PRadio: import('./elementConfiguration').ElementConfiguration<import('./PRadio/pRadio.definition').PRadioDocumentProps & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
37
- PSelect: import('./elementConfiguration').ElementConfiguration<import('./PSelect/pSelect.definition').PSelectDocumentProps & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
38
- PTable: import('./elementConfiguration').ElementConfiguration<import('./PTable/pTable.definition').PTableDocumentProps & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
55
+ PDivider: import('./elementConfiguration').ElementConfiguration<import('../elements/divider/definition').PDividerDocumentProps & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
56
+ PTextField: import('./elementConfiguration').ElementConfiguration<import('../elements/text-field/definition').PTextFieldDocumentProps & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
57
+ PTextArea: import('./elementConfiguration').ElementConfiguration<import('../elements/text-area/definition').PTextAreaDocumentProps & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
58
+ PCheckbox: import('./elementConfiguration').ElementConfiguration<import('../elements/checkbox/definition').PCheckboxDocumentProps & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
59
+ PRadio: import('./elementConfiguration').ElementConfiguration<import('../elements/radio/definition').PRadioDocumentProps & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
60
+ PSelect: import('./elementConfiguration').ElementConfiguration<import('../elements/select/definition').PSelectDocumentProps & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
61
+ PTable: import('./elementConfiguration').ElementConfiguration<import('../elements/table/definition').PTableDocumentProps & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
62
+ PArticle: import('./elementConfiguration').ElementConfiguration<import('../definitions').PArticleDocumentProps & Partial<import('./deviceVisibility').DeviceVisibility> & Partial<Record<"tabletStyle" | "mobileStyle" | "tabletLandscapeStyle" | "mobileLandscapeStyle", Partial<Record<string, unknown>>>>>;
39
63
  };
40
64
  export declare function isElementType(value: unknown): value is ElementType;
@@ -1,24 +1,16 @@
1
1
  import { z } from 'zod';
2
2
  import { ElementStyle, ElementStyleKind } from './style/elementStyle';
3
3
  import { StyleDefinition } from './styleItems';
4
- export declare const lengthValue: z.ZodString;
5
- export declare const lengthKeys: readonly [readonly ["width", "width", "Width"], readonly ["height", "height", "Height"], readonly ["minWidth", "min-width", "Min width"], readonly ["minHeight", "min-height", "Min height"], readonly ["maxWidth", "max-width", "Max width"], readonly ["maxHeight", "max-height", "Max height"], readonly ["paddingTop", "padding-top", "Padding top"], readonly ["paddingBottom", "padding-bottom", "Padding bottom"], readonly ["paddingLeft", "padding-left", "Padding left"], readonly ["paddingRight", "padding-right", "Padding right"], readonly ["marginTop", "margin-top", "Margin top"], readonly ["marginBottom", "margin-bottom", "Margin bottom"], readonly ["marginLeft", "margin-left", "Margin left"], readonly ["marginRight", "margin-right", "Margin right"], readonly ["borderRadiusTopLeft", "border-top-left-radius", "Radius top left"], readonly ["borderRadiusTopRight", "border-top-right-radius", "Radius top right"], readonly ["borderRadiusBottomRight", "border-bottom-right-radius", "Radius bottom right"], readonly ["borderRadiusBottomLeft", "border-bottom-left-radius", "Radius bottom left"]];
4
+ export { lengthValue, colorValue, borderWidthValue } from './styleTokensSchema';
5
+ export declare const lengthKeys: readonly [readonly ["width", "width", "Width"], readonly ["height", "height", "Height"], readonly ["minWidth", "min-width", "Min width"], readonly ["minHeight", "min-height", "Min height"], readonly ["maxWidth", "max-width", "Max width"], readonly ["maxHeight", "max-height", "Max height"], readonly ["paddingTop", "padding-top", "Padding top"], readonly ["paddingBottom", "padding-bottom", "Padding bottom"], readonly ["paddingLeft", "padding-left", "Padding start"], readonly ["paddingRight", "padding-right", "Padding end"], readonly ["marginTop", "margin-top", "Margin top"], readonly ["marginBottom", "margin-bottom", "Margin bottom"], readonly ["marginLeft", "margin-left", "Margin start"], readonly ["marginRight", "margin-right", "Margin end"], readonly ["borderRadiusTopLeft", "border-top-left-radius", "Radius top left"], readonly ["borderRadiusTopRight", "border-top-right-radius", "Radius top right"], readonly ["borderRadiusBottomRight", "border-bottom-right-radius", "Radius bottom right"], readonly ["borderRadiusBottomLeft", "border-bottom-left-radius", "Radius bottom left"]];
6
6
  export type LengthKey = (typeof lengthKeys)[number][0];
7
7
  export declare function elementStyleDefinitions(kind: ElementStyleKind, defaults: ElementStyle): StyleDefinition[];
8
- export declare function elementStyleSchema(definitions: StyleDefinition[], defaults: ElementStyle): z.ZodPipe<z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodObject<{
9
- key: z.ZodString;
10
- variable: z.ZodOptional<z.ZodString>;
11
- variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
12
- attribute: z.ZodOptional<z.ZodString>;
13
- value: z.ZodUnknown;
14
- }, z.core.$strict>>>, z.ZodTransform<{
8
+ export declare function elementStyleSchema(definitions: StyleDefinition[], defaults: ElementStyle): z.ZodPipe<z.ZodPipe<z.ZodOptional<z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodTransform<{
9
+ [x: string]: unknown;
10
+ }, Record<string, unknown>>>>, z.ZodTransform<{
15
11
  [x: string]: unknown;
16
12
  }, {
17
- key: string;
18
- value: unknown;
19
- variable?: string | undefined;
20
- variables?: Record<string, string> | undefined;
21
- attribute?: string | undefined;
22
- }[]>>, z.ZodTransform<ElementStyle, {
13
+ [x: string]: unknown;
14
+ } | undefined>>, z.ZodTransform<ElementStyle, {
23
15
  [x: string]: unknown;
24
16
  }>>;
@@ -1,8 +1,9 @@
1
1
  import { RegisteredElementConfiguration } from './elementConfiguration';
2
2
  /**
3
3
  * A preset shown on the Templates tab. `shortcode` is a JSON object in the
4
- * page-document format. A style item without its address only works for a key
5
- * the element already has. `children` replaces that element's content.
4
+ * page-document format. Style is a sparse key → value object (legacy style
5
+ * item arrays are accepted and rewritten). `children` replaces that element's
6
+ * content.
6
7
  */
7
8
  export type ElementTemplate = {
8
9
  shortcode: string;
@@ -1,12 +1,15 @@
1
1
  import { z } from 'zod';
2
2
  import { DocumentAttributes } from './elementConfiguration';
3
3
  export declare const LINK_TARGETS: readonly ["_self", "_blank"];
4
+ export declare const LINK_RELS: readonly ["", "nofollow", "sponsored", "ugc"];
4
5
  export type LinkTarget = (typeof LINK_TARGETS)[number];
6
+ export type LinkRel = (typeof LINK_RELS)[number];
5
7
  /** An empty `href` means the element is not a link. */
6
8
  export type LinkSettings = {
7
9
  href: string;
8
10
  target: LinkTarget;
9
11
  description: string;
12
+ rel: LinkRel;
10
13
  };
11
14
  export declare const defaultLinkSettings: LinkSettings;
12
15
  export declare const linkSettingsShape: {
@@ -16,11 +19,25 @@ export declare const linkSettingsShape: {
16
19
  _blank: "_blank";
17
20
  }>>;
18
21
  description: z.ZodDefault<z.ZodString>;
22
+ rel: z.ZodDefault<z.ZodEnum<{
23
+ "": "";
24
+ nofollow: "nofollow";
25
+ sponsored: "sponsored";
26
+ ugc: "ugc";
27
+ }>>;
19
28
  };
20
29
  export declare const linkHistoryLabels: {
21
30
  href: string;
22
31
  target: string;
23
32
  description: string;
33
+ rel: string;
24
34
  };
25
- /** Writes only what differs from no link: the address, a new tab, and a description. */
26
- export declare function toLinkAttributes({ href, target, description }: LinkSettings): DocumentAttributes;
35
+ /** Merge authored rel with security tokens for new tabs. */
36
+ export declare function linkRelAttribute(target: LinkTarget, rel?: string): string | undefined;
37
+ /** Writes only what differs from no link: the address, a new tab, a description, and rel. */
38
+ export declare function toLinkAttributes({ href, target, description, rel, }: {
39
+ href: string;
40
+ target?: LinkTarget;
41
+ description?: string;
42
+ rel?: string;
43
+ }): DocumentAttributes;
@@ -1,5 +1,5 @@
1
1
  import { BackgroundStyle } from '../Fields/BackgroundField/backgroundValue';
2
- import { ColorValue } from '../Fields/ColorField/color-value';
2
+ import { StyleColor } from '../../render/styleTokens';
3
3
  export declare const BORDER_LINE_STYLES: readonly ["none", "solid", "dashed", "dotted", "double"];
4
4
  export type BorderLineStyle = (typeof BORDER_LINE_STYLES)[number];
5
5
  export declare const FLEX_DIRECTIONS: readonly ["row", "column", "row-reverse", "column-reverse"];
@@ -15,7 +15,7 @@ export type FlexAlignContent = (typeof FLEX_ALIGN_CONTENTS)[number];
15
15
  export type ElementLayout = 'block' | 'flex' | 'grid';
16
16
  export type ElementOverflow = 'show' | 'hide';
17
17
  export type GridColumnCount = 2 | 3 | 4;
18
- export type ElementStyleKind = 'section' | 'container';
18
+ export type ElementStyleKind = 'section' | 'container' | 'footer' | 'nav';
19
19
  export type ElementStyle = {
20
20
  layout: ElementLayout;
21
21
  gridColumns?: GridColumnCount;
@@ -49,7 +49,7 @@ export type ElementStyle = {
49
49
  borderRadiusBottomLeft: string;
50
50
  borderWidth: string;
51
51
  borderStyle: BorderLineStyle;
52
- borderColor: ColorValue;
52
+ borderColor: StyleColor;
53
53
  } & BackgroundStyle;
54
54
  export declare const defaultElementStyle: ElementStyle;
55
55
  export declare const LENGTH_PATTERN: RegExp;
@@ -1,3 +1,3 @@
1
- import { ColorValue } from '../Fields/ColorField/color-value';
2
- export declare function colorValueToCss(value: ColorValue): string | undefined;
1
+ import { StyleColor } from '../../render/styleTokens';
2
+ export declare function colorValueToCss(value: StyleColor): string | undefined;
3
3
  export declare function textSizeToCss(size: number): string | undefined;
@@ -6,6 +6,10 @@ export type StyleItem = {
6
6
  attribute?: string;
7
7
  value: unknown;
8
8
  };
9
+ export type StyleDocumentCodec = {
10
+ schema: z.ZodType;
11
+ encode: (value: unknown) => unknown;
12
+ };
9
13
  export type StyleDefinition = {
10
14
  key: string;
11
15
  variable?: string;
@@ -16,6 +20,8 @@ export type StyleDefinition = {
16
20
  defaultValue?: unknown;
17
21
  /** How the page history names this key. */
18
22
  label?: string;
23
+ /** When set, the document stores this key through encode/schema instead of `value`. */
24
+ document?: StyleDocumentCodec;
19
25
  };
20
26
  type StyleValues = Record<string, unknown>;
21
27
  export declare function styleItemsSchema(definitions: StyleDefinition[]): z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -50,4 +56,16 @@ export declare function styleLabels(definitions: StyleDefinition[], pathPrefix?:
50
56
  /** Keys missing from `values` (or an absent `values`) use the definition default. */
51
57
  export declare function toStyleItems(values: StyleValues | undefined, definitions: StyleDefinition[]): StyleItem[];
52
58
  export declare function toStyleOverrideItems(values: StyleValues | undefined, definitions: StyleDefinition[]): StyleItem[];
59
+ /** Sparse document style: key → value, no defaults, no CSS addresses. */
60
+ export declare function toDocumentStyle(values: StyleValues | undefined, definitions: StyleDefinition[]): StyleValues | undefined;
61
+ /** Spreads a document style only when at least one key remains. */
62
+ export declare function documentStyleAttribute(style: StyleValues | undefined): {
63
+ style: StyleValues;
64
+ } | Record<string, never>;
65
+ /** Sparse device override style for the document. */
66
+ export declare function toDocumentStyleOverride(values: StyleValues | undefined, definitions: StyleDefinition[]): StyleValues | undefined;
67
+ /** Document `style` object: fills definition defaults for omitted keys. */
68
+ export declare function documentStyleSchema(definitions: StyleDefinition[]): z.ZodPipe<z.ZodOptional<z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodTransform<StyleValues, Record<string, unknown>>>>, z.ZodTransform<StyleValues, StyleValues | undefined>>;
69
+ /** Device override style object: only the keys the document sets. */
70
+ export declare function documentStyleOverrideSchema(definitions: StyleDefinition[]): z.ZodPipe<z.ZodOptional<z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodTransform<StyleValues, Record<string, unknown>>>>, z.ZodTransform<StyleValues, StyleValues | undefined>>;
53
71
  export {};
@@ -0,0 +1,290 @@
1
+ import { z } from 'zod';
2
+ import { StyleDefinition } from './styleItems';
3
+ declare const spacingToken: z.ZodEnum<{
4
+ auto: "auto";
5
+ 0: "0";
6
+ 1: "1";
7
+ 2: "2";
8
+ 3: "3";
9
+ 4: "4";
10
+ px: "px";
11
+ 0.5: "0.5";
12
+ 1.5: "1.5";
13
+ 2.5: "2.5";
14
+ 3.5: "3.5";
15
+ 5: "5";
16
+ 6: "6";
17
+ 7: "7";
18
+ 8: "8";
19
+ 9: "9";
20
+ 10: "10";
21
+ 11: "11";
22
+ 12: "12";
23
+ 14: "14";
24
+ 16: "16";
25
+ 20: "20";
26
+ 24: "24";
27
+ 28: "28";
28
+ 32: "32";
29
+ 36: "36";
30
+ 40: "40";
31
+ 44: "44";
32
+ 48: "48";
33
+ 52: "52";
34
+ 56: "56";
35
+ 60: "60";
36
+ 64: "64";
37
+ 72: "72";
38
+ 80: "80";
39
+ 96: "96";
40
+ }>;
41
+ declare const borderWidthToken: z.ZodEnum<{
42
+ 0: "0";
43
+ 1: "1";
44
+ 2: "2";
45
+ 4: "4";
46
+ 8: "8";
47
+ }>;
48
+ declare const radiusToken: z.ZodEnum<{
49
+ 0: "0";
50
+ 1: "1";
51
+ 2: "2";
52
+ 3: "3";
53
+ 4: "4";
54
+ px: "px";
55
+ 0.5: "0.5";
56
+ 1.5: "1.5";
57
+ 2.5: "2.5";
58
+ 3.5: "3.5";
59
+ 5: "5";
60
+ 6: "6";
61
+ 7: "7";
62
+ 8: "8";
63
+ 9: "9";
64
+ 10: "10";
65
+ 11: "11";
66
+ 12: "12";
67
+ 14: "14";
68
+ 16: "16";
69
+ none: "none";
70
+ sm: "sm";
71
+ md: "md";
72
+ lg: "lg";
73
+ xl: "xl";
74
+ "2xl": "2xl";
75
+ "3xl": "3xl";
76
+ full: "full";
77
+ }>;
78
+ declare const textSizeToken: z.ZodEnum<{
79
+ sm: "sm";
80
+ lg: "lg";
81
+ xl: "xl";
82
+ "2xl": "2xl";
83
+ "3xl": "3xl";
84
+ xs: "xs";
85
+ base: "base";
86
+ "4xl": "4xl";
87
+ "5xl": "5xl";
88
+ "6xl": "6xl";
89
+ }>;
90
+ declare const leadingToken: z.ZodEnum<{
91
+ 3: "3";
92
+ 4: "4";
93
+ 5: "5";
94
+ 6: "6";
95
+ 7: "7";
96
+ 8: "8";
97
+ 9: "9";
98
+ 10: "10";
99
+ none: "none";
100
+ tight: "tight";
101
+ snug: "snug";
102
+ normal: "normal";
103
+ relaxed: "relaxed";
104
+ loose: "loose";
105
+ }>;
106
+ declare const trackingToken: z.ZodEnum<{
107
+ tight: "tight";
108
+ normal: "normal";
109
+ tighter: "tighter";
110
+ wide: "wide";
111
+ wider: "wider";
112
+ widest: "widest";
113
+ }>;
114
+ /** Spacing / size: Tailwind token or a legacy CSS length. */
115
+ export declare const lengthValue: z.ZodUnion<readonly [z.ZodEnum<{
116
+ auto: "auto";
117
+ 0: "0";
118
+ 1: "1";
119
+ 2: "2";
120
+ 3: "3";
121
+ 4: "4";
122
+ px: "px";
123
+ 0.5: "0.5";
124
+ 1.5: "1.5";
125
+ 2.5: "2.5";
126
+ 3.5: "3.5";
127
+ 5: "5";
128
+ 6: "6";
129
+ 7: "7";
130
+ 8: "8";
131
+ 9: "9";
132
+ 10: "10";
133
+ 11: "11";
134
+ 12: "12";
135
+ 14: "14";
136
+ 16: "16";
137
+ 20: "20";
138
+ 24: "24";
139
+ 28: "28";
140
+ 32: "32";
141
+ 36: "36";
142
+ 40: "40";
143
+ 44: "44";
144
+ 48: "48";
145
+ 52: "52";
146
+ 56: "56";
147
+ 60: "60";
148
+ 64: "64";
149
+ 72: "72";
150
+ 80: "80";
151
+ 96: "96";
152
+ }>, z.ZodEnum<{
153
+ 0: "0";
154
+ 1: "1";
155
+ 2: "2";
156
+ 3: "3";
157
+ 4: "4";
158
+ px: "px";
159
+ 0.5: "0.5";
160
+ 1.5: "1.5";
161
+ 2.5: "2.5";
162
+ 3.5: "3.5";
163
+ 5: "5";
164
+ 6: "6";
165
+ 7: "7";
166
+ 8: "8";
167
+ 9: "9";
168
+ 10: "10";
169
+ 11: "11";
170
+ 12: "12";
171
+ 14: "14";
172
+ 16: "16";
173
+ none: "none";
174
+ sm: "sm";
175
+ md: "md";
176
+ lg: "lg";
177
+ xl: "xl";
178
+ "2xl": "2xl";
179
+ "3xl": "3xl";
180
+ full: "full";
181
+ }>, z.ZodString]>;
182
+ /** Border width: Tailwind token or a legacy CSS length. */
183
+ export declare const borderWidthValue: z.ZodUnion<readonly [z.ZodEnum<{
184
+ 0: "0";
185
+ 1: "1";
186
+ 2: "2";
187
+ 4: "4";
188
+ 8: "8";
189
+ }>, z.ZodString]>;
190
+ /** Text size: Tailwind token, legacy pixel number, or CSS length. */
191
+ export declare const textSizeValue: z.ZodUnion<readonly [z.ZodEnum<{
192
+ sm: "sm";
193
+ lg: "lg";
194
+ xl: "xl";
195
+ "2xl": "2xl";
196
+ "3xl": "3xl";
197
+ xs: "xs";
198
+ base: "base";
199
+ "4xl": "4xl";
200
+ "5xl": "5xl";
201
+ "6xl": "6xl";
202
+ }>, z.ZodNumber, z.ZodString]>;
203
+ export declare const lineHeightValue: z.ZodUnion<readonly [z.ZodEnum<{
204
+ 3: "3";
205
+ 4: "4";
206
+ 5: "5";
207
+ 6: "6";
208
+ 7: "7";
209
+ 8: "8";
210
+ 9: "9";
211
+ 10: "10";
212
+ none: "none";
213
+ tight: "tight";
214
+ snug: "snug";
215
+ normal: "normal";
216
+ relaxed: "relaxed";
217
+ loose: "loose";
218
+ }>, z.ZodString]>;
219
+ export declare const letterSpacingValue: z.ZodUnion<readonly [z.ZodEnum<{
220
+ tight: "tight";
221
+ normal: "normal";
222
+ tighter: "tighter";
223
+ wide: "wide";
224
+ wider: "wider";
225
+ widest: "widest";
226
+ }>, z.ZodString]>;
227
+ declare const hexColor: z.ZodObject<{
228
+ hex: z.ZodString;
229
+ opacity: z.ZodNumber;
230
+ }, z.core.$strict>;
231
+ declare const paletteColor: z.ZodObject<{
232
+ name: z.ZodEnum<{
233
+ accent: "accent";
234
+ "accent-50": "accent-50";
235
+ "accent-100": "accent-100";
236
+ "accent-700": "accent-700";
237
+ "accent-foreground": "accent-foreground";
238
+ transparent: "transparent";
239
+ white: "white";
240
+ black: "black";
241
+ "slate-50": "slate-50";
242
+ "slate-100": "slate-100";
243
+ "slate-200": "slate-200";
244
+ "slate-300": "slate-300";
245
+ "slate-400": "slate-400";
246
+ "slate-500": "slate-500";
247
+ "slate-600": "slate-600";
248
+ "slate-700": "slate-700";
249
+ "slate-800": "slate-800";
250
+ "slate-900": "slate-900";
251
+ "slate-950": "slate-950";
252
+ }>;
253
+ opacity: z.ZodNumber;
254
+ }, z.core.$strict>;
255
+ /** Palette token or legacy hex color. */
256
+ export declare const colorValue: z.ZodUnion<readonly [z.ZodObject<{
257
+ name: z.ZodEnum<{
258
+ accent: "accent";
259
+ "accent-50": "accent-50";
260
+ "accent-100": "accent-100";
261
+ "accent-700": "accent-700";
262
+ "accent-foreground": "accent-foreground";
263
+ transparent: "transparent";
264
+ white: "white";
265
+ black: "black";
266
+ "slate-50": "slate-50";
267
+ "slate-100": "slate-100";
268
+ "slate-200": "slate-200";
269
+ "slate-300": "slate-300";
270
+ "slate-400": "slate-400";
271
+ "slate-500": "slate-500";
272
+ "slate-600": "slate-600";
273
+ "slate-700": "slate-700";
274
+ "slate-800": "slate-800";
275
+ "slate-900": "slate-900";
276
+ "slate-950": "slate-950";
277
+ }>;
278
+ opacity: z.ZodNumber;
279
+ }, z.core.$strict>, z.ZodObject<{
280
+ hex: z.ZodString;
281
+ opacity: z.ZodNumber;
282
+ }, z.core.$strict>]>;
283
+ /** Document color string → editor `{ hex, opacity }` or `{ name, opacity }`. */
284
+ export declare const documentColorValue: z.ZodPipe<z.ZodString, z.ZodTransform<import('../definitions').PaletteColor | {
285
+ hex: string;
286
+ opacity: number;
287
+ }, string>>;
288
+ /** Style definition that stores colors as compact document strings. */
289
+ export declare function colorStyle(definition: Omit<StyleDefinition, 'value' | 'document'>): StyleDefinition;
290
+ export { spacingToken, borderWidthToken, radiusToken, textSizeToken, leadingToken, trackingToken, hexColor, paletteColor, };
package/dist/tags.json CHANGED
@@ -2,8 +2,11 @@
2
2
  "plmt-page",
3
3
  "plmt-section",
4
4
  "plmt-container",
5
+ "plmt-nav",
6
+ "plmt-footer",
5
7
  "plmt-button",
6
8
  "plmt-text",
9
+ "plmt-heading",
7
10
  "plmt-rich-text",
8
11
  "plmt-image",
9
12
  "plmt-video",
@@ -15,5 +18,6 @@
15
18
  "plmt-text-area",
16
19
  "plmt-checkbox",
17
20
  "plmt-radio",
18
- "plmt-select"
21
+ "plmt-select",
22
+ "plmt-article"
19
23
  ]
@@ -0,0 +1,5 @@
1
+ import { ElementSpec } from '../../render/types';
2
+ export declare const BRAND_NETWORKS: readonly ["facebook", "x", "instagram", "linkedin", "youtube"];
3
+ export type BrandNetwork = (typeof BRAND_NETWORKS)[number];
4
+ export declare function brandSpec(network: string): ElementSpec | null;
5
+ export declare function brandLabel(network: BrandNetwork): string;
@@ -1,10 +1,5 @@
1
- import { ElementType } from '../schema/elementConfiguration';
2
- import { ElementSpec, ElementSpecOptions } from '../render/types';
3
- export type ShortcodeNode = {
4
- type: ElementType;
5
- props: Record<string, unknown>;
6
- children?: ShortcodeNode[];
7
- };
1
+ import { ElementSpec, ElementSpecOptions, ShortcodeNode } from '../render/types';
2
+ export type { ShortcodeNode };
8
3
  /**
9
4
  * Convert one shortcode node into a semantic HTML element spec without recursing
10
5
  * into layout children. Pass `options.children` for slots (builder) or let
@@ -12,4 +7,4 @@ export type ShortcodeNode = {
12
7
  */
13
8
  export declare function elementSpec(node: ShortcodeNode, options?: ElementSpecOptions): ElementSpec | null;
14
9
  /** Convert a parsed shortcode node into a semantic HTML element tree. */
15
- export declare function toElementTree(node: ShortcodeNode): ElementSpec | null;
10
+ export declare function toElementTree(node: ShortcodeNode, context?: ElementSpecOptions['context']): ElementSpec | null;