@atlfluidart/rulecms-widgets 0.1.0
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/README.md +60 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +107 -0
- package/dist/index.esm.js +2 -0
- package/dist/index.esm.js.map +1 -0
- package/package.json +74 -0
package/README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# @atlfluidart/rulecms-widgets
|
|
2
|
+
|
|
3
|
+
ATL Fluid Art's RuleCMS component library — the first customer library
|
|
4
|
+
("customer zero") built on the `@rulecms/widget-react` v15 multi-tenant
|
|
5
|
+
component library contract, and the reference implementation for library
|
|
6
|
+
authors.
|
|
7
|
+
|
|
8
|
+
## What this is
|
|
9
|
+
|
|
10
|
+
A separately versioned React component library that RuleCMS widgets can
|
|
11
|
+
reference per component via `libraryId: "atlfluidart"`. It conforms to
|
|
12
|
+
widget-react's `ComponentLibraryModule` contract **structurally** — no
|
|
13
|
+
dependency on `@rulecms/widget-react` (a devDependency-only type test
|
|
14
|
+
guarantees the shape).
|
|
15
|
+
|
|
16
|
+
## Components
|
|
17
|
+
|
|
18
|
+
| Type | Description |
|
|
19
|
+
|---|---|
|
|
20
|
+
| `coming-soon-message` | Centered, padded announcement text (CMS-editable via `content-text-3-resolutions`; defaults to "New Experiences coming soon") |
|
|
21
|
+
|
|
22
|
+
## Usage (consumer app)
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import * as atlfluidartWidgets from '@atlfluidart/rulecms-widgets';
|
|
26
|
+
|
|
27
|
+
<RuleCMSWidgetProvider
|
|
28
|
+
token={token}
|
|
29
|
+
libraries={{
|
|
30
|
+
default: sourceComponents, // @rulecms/source-components-react
|
|
31
|
+
atlfluidart: atlfluidartWidgets, // eager (SSR) — or a thunk to code-split
|
|
32
|
+
}}
|
|
33
|
+
>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
A widget config references a component from this library as:
|
|
37
|
+
|
|
38
|
+
```jsonc
|
|
39
|
+
{ "id": "col-1", "type": "coming-soon-message", "libraryId": "atlfluidart" }
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Library-author conventions demonstrated here
|
|
43
|
+
|
|
44
|
+
- `manifest` / `components` / `editor` top-level exports (module namespace IS
|
|
45
|
+
the `ComponentLibraryModule`).
|
|
46
|
+
- React/react-dom externalized (peer dependencies) — never bundled.
|
|
47
|
+
- Kebab-case component type ids; CMS attributes use the
|
|
48
|
+
`-3-resolutions` convention (`content-text-3-resolutions`, standard
|
|
49
|
+
dimension and `hide-widget` attributes).
|
|
50
|
+
- Render surface (`components`) carries no editor-only configuration; the
|
|
51
|
+
optional `editor` surface provides palette previews and attribute metadata
|
|
52
|
+
for the RuleCMS composer.
|
|
53
|
+
|
|
54
|
+
## Scripts
|
|
55
|
+
|
|
56
|
+
- `npm test` — contract conformance + Node SSR render tests (including an
|
|
57
|
+
end-to-end render through `@rulecms/widget-react` with the namespaced
|
|
58
|
+
`libraryId`).
|
|
59
|
+
- `npm run build` — rollup → `dist/` (ESM + CJS + d.ts).
|
|
60
|
+
- `npm run release` — test + typecheck + build + publish (user-run).
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime");function t({widgetAttributes:t}){const i=t?.["content-text-3-resolutions"],n=("string"==typeof i&&i.length?i:void 0)??"New Experiences coming soon";return e.jsx("div",{style:{padding:"4rem 1.5rem",textAlign:"center"},children:e.jsx("p",{style:{margin:0,fontSize:"1.5rem",lineHeight:1.4,fontWeight:600},children:n})})}const i={comingSoonMessage:"coming-soon-message"},n={id:i.comingSoonMessage,card:({widgetAttributes:i})=>e.jsx(t,{widgetAttributes:i}),defaultAttributeValues:[{name:"min-width-percentage-3-resolutions",defaultValues:{}},{name:"max-width-percentage-3-resolutions",defaultValues:{}},{name:"min-height-percentage-3-resolutions",defaultValues:{}},{name:"content-text-3-resolutions",defaultValues:{}},{name:"hide-widget-3-resolutions",defaultValues:{}}]},o={id:i.comingSoonMessage,card:()=>e.jsx("div",{style:{color:"#CCCCCC",padding:"4px 8px",textAlign:"center"},children:"New Experiences coming soon"})};const s={id:"atlfluidart",version:"0.1.0",reactPeerRange:">=16.8.0"},a={[n.id]:n},r={previewComponents:{[o.id]:o},previewCardGroups:[{title:"ATL Fluid Art",showInitially:!0,cards:[{title:"Announcements",entries:[o]}]}],componentMetadata:{attributeListForComponentTypes:{},componentNameToModifyAttribute:{},componentMetadata:{[i.comingSoonMessage]:{defaultAttributeValues:n.defaultAttributeValues,attributeEditModeConfigs:[{name:"content-text-3-resolutions",attributeTabName:"text",heading:"Message Text",subHeading:"Set the announcement text for 3 different device resolutions",defaultValues:{}},{name:"min-width-percentage-3-resolutions",attributeTabName:"min-width",heading:"Min Width Percentage",subHeading:"Set the minimum width for 3 different device resolutions",defaultValues:{}},{name:"max-width-percentage-3-resolutions",attributeTabName:"max-width",heading:"Max Width Percentage",subHeading:"Set the maximum width for 3 different device resolutions",defaultValues:{}},{name:"hide-widget-3-resolutions",attributeTabName:"hide-widget",heading:"Hide Widget",subHeading:"Set Show/Hide widget settings for 3 different device resolutions",defaultValues:{}}]}}}};exports.ComingSoonMessage=t,exports.ComponentIdentifiers=i,exports.components=a,exports.editor=r,exports.manifest=s;
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/components/coming-soon-message/ComingSoonMessage.tsx","../../src/components/coming-soon-message/default-attribute-values.ts","../../src/component-identifiers.ts","../../src/components/coming-soon-message/display-card-entry.tsx","../../src/components/coming-soon-message/editor-preview-entry.tsx","../../src/component-library-module.ts","../../src/components/coming-soon-message/attribute-edit-mode-configs.ts"],"sourcesContent":["const DEFAULT_MESSAGE = 'New Experiences coming soon';\n\n/**\n * Centered announcement message with comfortable padding. The text is\n * CMS-editable via the standard `content-text-3-resolutions` attribute\n * (same convention as the default library's text component); it falls back\n * to the default message when unset.\n */\nexport function ComingSoonMessage({\n widgetAttributes,\n}: Readonly<{\n widgetAttributes?: { [key: string]: any };\n}>) {\n const userAssignedText = widgetAttributes?.['content-text-3-resolutions'];\n const message =\n (typeof userAssignedText === 'string' && userAssignedText.length\n ? userAssignedText\n : undefined) ?? DEFAULT_MESSAGE;\n\n return (\n <div\n style={{\n padding: '4rem 1.5rem',\n textAlign: 'center',\n }}\n >\n <p\n style={{\n margin: 0,\n fontSize: '1.5rem',\n lineHeight: 1.4,\n fontWeight: 600,\n }}\n >\n {message}\n </p>\n </div>\n );\n}\n","import { DefaultAttributeValue } from '@atlfluidart-rulecms-widgets/types';\n\nexport const defaultAttributeValues: DefaultAttributeValue[] = [\n {\n name: 'min-width-percentage-3-resolutions',\n defaultValues: {},\n },\n {\n name: 'max-width-percentage-3-resolutions',\n defaultValues: {},\n },\n {\n name: 'min-height-percentage-3-resolutions',\n defaultValues: {},\n },\n {\n name: 'content-text-3-resolutions',\n defaultValues: {},\n },\n {\n name: 'hide-widget-3-resolutions',\n defaultValues: {},\n },\n];\n","type ComponentIdentifier = 'coming-soon-message';\n\nexport const ComponentIdentifiers: Record<string, ComponentIdentifier> = {\n comingSoonMessage: 'coming-soon-message',\n} as const;\n","import { ComingSoonMessage } from './ComingSoonMessage';\nimport { defaultAttributeValues } from './default-attribute-values';\nimport type { LibraryComponentEntry } from '@atlfluidart-rulecms-widgets/types';\nimport { ComponentIdentifiers } from '@atlfluidart-rulecms-widgets/component-identifiers';\n\nexport const displayCardEntry: LibraryComponentEntry = {\n id: ComponentIdentifiers.comingSoonMessage,\n card: ({\n widgetAttributes,\n }: {\n widgetAttributes?: { [key: string]: any };\n }) => <ComingSoonMessage widgetAttributes={widgetAttributes} />,\n defaultAttributeValues,\n};\n","import type { EditorPreviewEntry } from '@atlfluidart-rulecms-widgets/types';\nimport { ComponentIdentifiers } from '@atlfluidart-rulecms-widgets/component-identifiers';\n\n/** Compact palette/drag preview for the composer. */\nexport const editorPreviewEntry: EditorPreviewEntry = {\n id: ComponentIdentifiers.comingSoonMessage,\n card: () => (\n <div style={{ color: '#CCCCCC', padding: '4px 8px', textAlign: 'center' }}>\n New Experiences coming soon\n </div>\n ),\n};\n","import { displayCardEntry } from './components/coming-soon-message/display-card-entry';\nimport { editorPreviewEntry } from './components/coming-soon-message/editor-preview-entry';\nimport { attributeEditModeConfigs } from './components/coming-soon-message/attribute-edit-mode-configs';\nimport { ComponentIdentifiers } from './component-identifiers';\nimport type {\n LibraryComponentEntry,\n EditorPreviewEntry,\n LibraryCardGroup,\n ComponentMetadataForEditing,\n} from './types';\nimport packageJson from '../package.json';\n\n/**\n * ComponentLibraryModule conformance (the @rulecms/widget-react contract).\n *\n * ATL Fluid Art's component library — \"customer zero\" of the multi-tenant\n * component library architecture. Registered by the consumer app under the\n * libraryId \"atlfluidart\"; config components reference it as\n * `{ \"type\": \"coming-soon-message\", \"libraryId\": \"atlfluidart\" }` and the\n * render pipeline resolves them via the namespaced key\n * `atlfluidart/coming-soon-message`.\n */\n\nexport const manifest = {\n id: 'atlfluidart',\n version: packageJson.version,\n reactPeerRange: '>=16.8.0',\n};\n\n/** The render surface: component type → renderable entry. */\nexport const components: Record<string, LibraryComponentEntry> = {\n [displayCardEntry.id]: displayCardEntry,\n};\n\n/** The editor surface: palette + attribute metadata for the RuleCMS composer. */\nexport const editor = {\n previewComponents: {\n [editorPreviewEntry.id]: editorPreviewEntry,\n } as Record<string, EditorPreviewEntry>,\n previewCardGroups: [\n {\n title: 'ATL Fluid Art',\n showInitially: true,\n cards: [{ title: 'Announcements', entries: [editorPreviewEntry] }],\n },\n ] as LibraryCardGroup[],\n componentMetadata: {\n attributeListForComponentTypes: {},\n componentNameToModifyAttribute: {},\n componentMetadata: {\n [ComponentIdentifiers.comingSoonMessage]: {\n defaultAttributeValues: displayCardEntry.defaultAttributeValues,\n attributeEditModeConfigs,\n },\n },\n } as ComponentMetadataForEditing,\n};\n","import { AttributeEditModeConfig } from '@atlfluidart-rulecms-widgets/types';\n\nexport const attributeEditModeConfigs: AttributeEditModeConfig[] = [\n {\n name: 'content-text-3-resolutions',\n attributeTabName: 'text',\n heading: 'Message Text',\n subHeading: 'Set the announcement text for 3 different device resolutions',\n defaultValues: {},\n },\n {\n name: 'min-width-percentage-3-resolutions',\n attributeTabName: 'min-width',\n heading: 'Min Width Percentage',\n subHeading: 'Set the minimum width for 3 different device resolutions',\n defaultValues: {},\n },\n {\n name: 'max-width-percentage-3-resolutions',\n attributeTabName: 'max-width',\n heading: 'Max Width Percentage',\n subHeading: 'Set the maximum width for 3 different device resolutions',\n defaultValues: {},\n },\n {\n name: 'hide-widget-3-resolutions',\n attributeTabName: 'hide-widget',\n heading: 'Hide Widget',\n subHeading: 'Set Show/Hide widget settings for 3 different device resolutions',\n defaultValues: {},\n },\n];\n"],"names":["ComingSoonMessage","widgetAttributes","userAssignedText","message","length","undefined","_jsx","style","padding","textAlign","children","margin","fontSize","lineHeight","fontWeight","ComponentIdentifiers","comingSoonMessage","displayCardEntry","id","card","defaultAttributeValues","name","defaultValues","editorPreviewEntry","color","manifest","version","reactPeerRange","components","editor","previewComponents","previewCardGroups","title","showInitially","cards","entries","componentMetadata","attributeListForComponentTypes","componentNameToModifyAttribute","attributeEditModeConfigs","attributeTabName","heading","subHeading"],"mappings":"gDAQM,SAAUA,GAAkBC,iBAChCA,IAIA,MAAMC,EAAmBD,IAAmB,8BACtCE,GACyB,iBAArBD,GAAiCA,EAAiBE,OACtDF,OACAG,IAjBgB,8BAmBtB,OACEC,EAAAA,IAAA,MAAA,CACEC,MAAO,CACLC,QAAS,cACTC,UAAW,UACZC,SAEDJ,EAAAA,IAAA,IAAA,CACEC,MAAO,CACLI,OAAQ,EACRC,SAAU,SACVC,WAAY,IACZC,WAAY,KACbJ,SAEAP,KAIT,CCpCO,MCAMY,EAA4D,CACvEC,kBAAmB,uBCERC,EAA0C,CACrDC,GAAIH,EAAqBC,kBACzBG,KAAM,EACJlB,sBAGIK,EAAAA,IAACN,EAAiB,CAACC,iBAAkBA,IAC3CmB,uBFV6D,CAC7D,CACEC,KAAM,qCACNC,cAAe,CAAA,GAEjB,CACED,KAAM,qCACNC,cAAe,CAAA,GAEjB,CACED,KAAM,sCACNC,cAAe,CAAA,GAEjB,CACED,KAAM,6BACNC,cAAe,CAAA,GAEjB,CACED,KAAM,4BACNC,cAAe,CAAA,KGjBNC,EAAyC,CACpDL,GAAIH,EAAqBC,kBACzBG,KAAM,IACJb,EAAAA,IAAA,MAAA,CAAKC,MAAO,CAAEiB,MAAO,UAAWhB,QAAS,UAAWC,UAAW,UAAUC,SAAA,iCCgBtE,MAAMe,EAAW,CACtBP,GAAI,cACJQ,gBACAC,eAAgB,YAILC,EAAoD,CAC/D,CAACX,EAAiBC,IAAKD,GAIZY,EAAS,CACpBC,kBAAmB,CACjB,CAACP,EAAmBL,IAAKK,GAE3BQ,kBAAmB,CACjB,CACEC,MAAO,gBACPC,eAAe,EACfC,MAAO,CAAC,CAAEF,MAAO,gBAAiBG,QAAS,CAACZ,OAGhDa,kBAAmB,CACjBC,+BAAgC,CAAA,EAChCC,+BAAgC,CAAA,EAChCF,kBAAmB,CACjB,CAACrB,EAAqBC,mBAAoB,CACxCI,uBAAwBH,EAAiBG,uBACzCmB,yBClD2D,CACjE,CACElB,KAAM,6BACNmB,iBAAkB,OAClBC,QAAS,eACTC,WAAY,+DACZpB,cAAe,CAAA,GAEjB,CACED,KAAM,qCACNmB,iBAAkB,YAClBC,QAAS,uBACTC,WAAY,2DACZpB,cAAe,CAAA,GAEjB,CACED,KAAM,qCACNmB,iBAAkB,YAClBC,QAAS,uBACTC,WAAY,2DACZpB,cAAe,CAAA,GAEjB,CACED,KAAM,4BACNmB,iBAAkB,cAClBC,QAAS,cACTC,WAAY,mEACZpB,cAAe,CAAA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Local structural copies of the @rulecms/widget-react component-library
|
|
5
|
+
* contract shapes. The contract is satisfied STRUCTURALLY — this package has
|
|
6
|
+
* no runtime dependency on @rulecms/widget-react. The devDependency-only
|
|
7
|
+
* type-conformance test (__tests__/contract-conformance.test.ts) guarantees
|
|
8
|
+
* these stay assignable to the real contract.
|
|
9
|
+
*/
|
|
10
|
+
type DeviceTypeBasedAttributeValues = {
|
|
11
|
+
phone?: any;
|
|
12
|
+
tablet?: any;
|
|
13
|
+
desktop?: any;
|
|
14
|
+
all?: any;
|
|
15
|
+
};
|
|
16
|
+
type DefaultAttributeValue = {
|
|
17
|
+
name: string;
|
|
18
|
+
defaultValues: DeviceTypeBasedAttributeValues;
|
|
19
|
+
};
|
|
20
|
+
type RenderedOrFunctionalWidgetEntry = JSX.Element | ((props: {
|
|
21
|
+
widgetAttributes?: {
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
};
|
|
24
|
+
pageViewType: 'Preview' | 'Compose' | 'RenderedPage';
|
|
25
|
+
styleProps: {
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
} | undefined;
|
|
28
|
+
}) => JSX.Element);
|
|
29
|
+
type LibraryComponentEntry = {
|
|
30
|
+
id: string;
|
|
31
|
+
card: RenderedOrFunctionalWidgetEntry;
|
|
32
|
+
defaultAttributeValues: DefaultAttributeValue[];
|
|
33
|
+
};
|
|
34
|
+
type AttributeEditModeConfig = {
|
|
35
|
+
name: string;
|
|
36
|
+
attributeTabName: string;
|
|
37
|
+
heading?: string;
|
|
38
|
+
subHeading?: string;
|
|
39
|
+
defaultValues?: DeviceTypeBasedAttributeValues;
|
|
40
|
+
};
|
|
41
|
+
type EditorPreviewEntry = {
|
|
42
|
+
id: string;
|
|
43
|
+
card: RenderedOrFunctionalWidgetEntry;
|
|
44
|
+
};
|
|
45
|
+
type LibraryCard = {
|
|
46
|
+
title: string;
|
|
47
|
+
entries: EditorPreviewEntry[];
|
|
48
|
+
};
|
|
49
|
+
type LibraryCardGroup = {
|
|
50
|
+
title: string;
|
|
51
|
+
cards: LibraryCard[];
|
|
52
|
+
showInitially?: boolean;
|
|
53
|
+
};
|
|
54
|
+
type ComponentMetadata = {
|
|
55
|
+
defaultAttributeValues: DefaultAttributeValue[];
|
|
56
|
+
attributeEditModeConfigs: AttributeEditModeConfig[];
|
|
57
|
+
};
|
|
58
|
+
type ComponentMetadataForEditing = {
|
|
59
|
+
attributeListForComponentTypes: {
|
|
60
|
+
[key: string]: string[];
|
|
61
|
+
};
|
|
62
|
+
componentNameToModifyAttribute: {
|
|
63
|
+
[key: string]: string;
|
|
64
|
+
};
|
|
65
|
+
componentMetadata: Record<string, ComponentMetadata>;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* ComponentLibraryModule conformance (the @rulecms/widget-react contract).
|
|
70
|
+
*
|
|
71
|
+
* ATL Fluid Art's component library — "customer zero" of the multi-tenant
|
|
72
|
+
* component library architecture. Registered by the consumer app under the
|
|
73
|
+
* libraryId "atlfluidart"; config components reference it as
|
|
74
|
+
* `{ "type": "coming-soon-message", "libraryId": "atlfluidart" }` and the
|
|
75
|
+
* render pipeline resolves them via the namespaced key
|
|
76
|
+
* `atlfluidart/coming-soon-message`.
|
|
77
|
+
*/
|
|
78
|
+
declare const manifest: {
|
|
79
|
+
id: string;
|
|
80
|
+
version: string;
|
|
81
|
+
reactPeerRange: string;
|
|
82
|
+
};
|
|
83
|
+
/** The render surface: component type → renderable entry. */
|
|
84
|
+
declare const components: Record<string, LibraryComponentEntry>;
|
|
85
|
+
/** The editor surface: palette + attribute metadata for the RuleCMS composer. */
|
|
86
|
+
declare const editor: {
|
|
87
|
+
previewComponents: Record<string, EditorPreviewEntry>;
|
|
88
|
+
previewCardGroups: LibraryCardGroup[];
|
|
89
|
+
componentMetadata: ComponentMetadataForEditing;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
type ComponentIdentifier = 'coming-soon-message';
|
|
93
|
+
declare const ComponentIdentifiers: Record<string, ComponentIdentifier>;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Centered announcement message with comfortable padding. The text is
|
|
97
|
+
* CMS-editable via the standard `content-text-3-resolutions` attribute
|
|
98
|
+
* (same convention as the default library's text component); it falls back
|
|
99
|
+
* to the default message when unset.
|
|
100
|
+
*/
|
|
101
|
+
declare function ComingSoonMessage({ widgetAttributes, }: Readonly<{
|
|
102
|
+
widgetAttributes?: {
|
|
103
|
+
[key: string]: any;
|
|
104
|
+
};
|
|
105
|
+
}>): react.JSX.Element;
|
|
106
|
+
|
|
107
|
+
export { ComingSoonMessage, ComponentIdentifiers, components, editor, manifest };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";function t({widgetAttributes:t}){const i=t?.["content-text-3-resolutions"],n=("string"==typeof i&&i.length?i:void 0)??"New Experiences coming soon";return e("div",{style:{padding:"4rem 1.5rem",textAlign:"center"},children:e("p",{style:{margin:0,fontSize:"1.5rem",lineHeight:1.4,fontWeight:600},children:n})})}const i={comingSoonMessage:"coming-soon-message"},n={id:i.comingSoonMessage,card:({widgetAttributes:i})=>e(t,{widgetAttributes:i}),defaultAttributeValues:[{name:"min-width-percentage-3-resolutions",defaultValues:{}},{name:"max-width-percentage-3-resolutions",defaultValues:{}},{name:"min-height-percentage-3-resolutions",defaultValues:{}},{name:"content-text-3-resolutions",defaultValues:{}},{name:"hide-widget-3-resolutions",defaultValues:{}}]},a={id:i.comingSoonMessage,card:()=>e("div",{style:{color:"#CCCCCC",padding:"4px 8px",textAlign:"center"},children:"New Experiences coming soon"})};const o={id:"atlfluidart",version:"0.1.0",reactPeerRange:">=16.8.0"},s={[n.id]:n},d={previewComponents:{[a.id]:a},previewCardGroups:[{title:"ATL Fluid Art",showInitially:!0,cards:[{title:"Announcements",entries:[a]}]}],componentMetadata:{attributeListForComponentTypes:{},componentNameToModifyAttribute:{},componentMetadata:{[i.comingSoonMessage]:{defaultAttributeValues:n.defaultAttributeValues,attributeEditModeConfigs:[{name:"content-text-3-resolutions",attributeTabName:"text",heading:"Message Text",subHeading:"Set the announcement text for 3 different device resolutions",defaultValues:{}},{name:"min-width-percentage-3-resolutions",attributeTabName:"min-width",heading:"Min Width Percentage",subHeading:"Set the minimum width for 3 different device resolutions",defaultValues:{}},{name:"max-width-percentage-3-resolutions",attributeTabName:"max-width",heading:"Max Width Percentage",subHeading:"Set the maximum width for 3 different device resolutions",defaultValues:{}},{name:"hide-widget-3-resolutions",attributeTabName:"hide-widget",heading:"Hide Widget",subHeading:"Set Show/Hide widget settings for 3 different device resolutions",defaultValues:{}}]}}}};export{t as ComingSoonMessage,i as ComponentIdentifiers,s as components,d as editor,o as manifest};
|
|
2
|
+
//# sourceMappingURL=index.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../src/components/coming-soon-message/ComingSoonMessage.tsx","../../src/components/coming-soon-message/default-attribute-values.ts","../../src/component-identifiers.ts","../../src/components/coming-soon-message/display-card-entry.tsx","../../src/components/coming-soon-message/editor-preview-entry.tsx","../../src/component-library-module.ts","../../src/components/coming-soon-message/attribute-edit-mode-configs.ts"],"sourcesContent":["const DEFAULT_MESSAGE = 'New Experiences coming soon';\n\n/**\n * Centered announcement message with comfortable padding. The text is\n * CMS-editable via the standard `content-text-3-resolutions` attribute\n * (same convention as the default library's text component); it falls back\n * to the default message when unset.\n */\nexport function ComingSoonMessage({\n widgetAttributes,\n}: Readonly<{\n widgetAttributes?: { [key: string]: any };\n}>) {\n const userAssignedText = widgetAttributes?.['content-text-3-resolutions'];\n const message =\n (typeof userAssignedText === 'string' && userAssignedText.length\n ? userAssignedText\n : undefined) ?? DEFAULT_MESSAGE;\n\n return (\n <div\n style={{\n padding: '4rem 1.5rem',\n textAlign: 'center',\n }}\n >\n <p\n style={{\n margin: 0,\n fontSize: '1.5rem',\n lineHeight: 1.4,\n fontWeight: 600,\n }}\n >\n {message}\n </p>\n </div>\n );\n}\n","import { DefaultAttributeValue } from '@atlfluidart-rulecms-widgets/types';\n\nexport const defaultAttributeValues: DefaultAttributeValue[] = [\n {\n name: 'min-width-percentage-3-resolutions',\n defaultValues: {},\n },\n {\n name: 'max-width-percentage-3-resolutions',\n defaultValues: {},\n },\n {\n name: 'min-height-percentage-3-resolutions',\n defaultValues: {},\n },\n {\n name: 'content-text-3-resolutions',\n defaultValues: {},\n },\n {\n name: 'hide-widget-3-resolutions',\n defaultValues: {},\n },\n];\n","type ComponentIdentifier = 'coming-soon-message';\n\nexport const ComponentIdentifiers: Record<string, ComponentIdentifier> = {\n comingSoonMessage: 'coming-soon-message',\n} as const;\n","import { ComingSoonMessage } from './ComingSoonMessage';\nimport { defaultAttributeValues } from './default-attribute-values';\nimport type { LibraryComponentEntry } from '@atlfluidart-rulecms-widgets/types';\nimport { ComponentIdentifiers } from '@atlfluidart-rulecms-widgets/component-identifiers';\n\nexport const displayCardEntry: LibraryComponentEntry = {\n id: ComponentIdentifiers.comingSoonMessage,\n card: ({\n widgetAttributes,\n }: {\n widgetAttributes?: { [key: string]: any };\n }) => <ComingSoonMessage widgetAttributes={widgetAttributes} />,\n defaultAttributeValues,\n};\n","import type { EditorPreviewEntry } from '@atlfluidart-rulecms-widgets/types';\nimport { ComponentIdentifiers } from '@atlfluidart-rulecms-widgets/component-identifiers';\n\n/** Compact palette/drag preview for the composer. */\nexport const editorPreviewEntry: EditorPreviewEntry = {\n id: ComponentIdentifiers.comingSoonMessage,\n card: () => (\n <div style={{ color: '#CCCCCC', padding: '4px 8px', textAlign: 'center' }}>\n New Experiences coming soon\n </div>\n ),\n};\n","import { displayCardEntry } from './components/coming-soon-message/display-card-entry';\nimport { editorPreviewEntry } from './components/coming-soon-message/editor-preview-entry';\nimport { attributeEditModeConfigs } from './components/coming-soon-message/attribute-edit-mode-configs';\nimport { ComponentIdentifiers } from './component-identifiers';\nimport type {\n LibraryComponentEntry,\n EditorPreviewEntry,\n LibraryCardGroup,\n ComponentMetadataForEditing,\n} from './types';\nimport packageJson from '../package.json';\n\n/**\n * ComponentLibraryModule conformance (the @rulecms/widget-react contract).\n *\n * ATL Fluid Art's component library — \"customer zero\" of the multi-tenant\n * component library architecture. Registered by the consumer app under the\n * libraryId \"atlfluidart\"; config components reference it as\n * `{ \"type\": \"coming-soon-message\", \"libraryId\": \"atlfluidart\" }` and the\n * render pipeline resolves them via the namespaced key\n * `atlfluidart/coming-soon-message`.\n */\n\nexport const manifest = {\n id: 'atlfluidart',\n version: packageJson.version,\n reactPeerRange: '>=16.8.0',\n};\n\n/** The render surface: component type → renderable entry. */\nexport const components: Record<string, LibraryComponentEntry> = {\n [displayCardEntry.id]: displayCardEntry,\n};\n\n/** The editor surface: palette + attribute metadata for the RuleCMS composer. */\nexport const editor = {\n previewComponents: {\n [editorPreviewEntry.id]: editorPreviewEntry,\n } as Record<string, EditorPreviewEntry>,\n previewCardGroups: [\n {\n title: 'ATL Fluid Art',\n showInitially: true,\n cards: [{ title: 'Announcements', entries: [editorPreviewEntry] }],\n },\n ] as LibraryCardGroup[],\n componentMetadata: {\n attributeListForComponentTypes: {},\n componentNameToModifyAttribute: {},\n componentMetadata: {\n [ComponentIdentifiers.comingSoonMessage]: {\n defaultAttributeValues: displayCardEntry.defaultAttributeValues,\n attributeEditModeConfigs,\n },\n },\n } as ComponentMetadataForEditing,\n};\n","import { AttributeEditModeConfig } from '@atlfluidart-rulecms-widgets/types';\n\nexport const attributeEditModeConfigs: AttributeEditModeConfig[] = [\n {\n name: 'content-text-3-resolutions',\n attributeTabName: 'text',\n heading: 'Message Text',\n subHeading: 'Set the announcement text for 3 different device resolutions',\n defaultValues: {},\n },\n {\n name: 'min-width-percentage-3-resolutions',\n attributeTabName: 'min-width',\n heading: 'Min Width Percentage',\n subHeading: 'Set the minimum width for 3 different device resolutions',\n defaultValues: {},\n },\n {\n name: 'max-width-percentage-3-resolutions',\n attributeTabName: 'max-width',\n heading: 'Max Width Percentage',\n subHeading: 'Set the maximum width for 3 different device resolutions',\n defaultValues: {},\n },\n {\n name: 'hide-widget-3-resolutions',\n attributeTabName: 'hide-widget',\n heading: 'Hide Widget',\n subHeading: 'Set Show/Hide widget settings for 3 different device resolutions',\n defaultValues: {},\n },\n];\n"],"names":["ComingSoonMessage","widgetAttributes","userAssignedText","message","length","undefined","_jsx","style","padding","textAlign","children","margin","fontSize","lineHeight","fontWeight","ComponentIdentifiers","comingSoonMessage","displayCardEntry","id","card","defaultAttributeValues","name","defaultValues","editorPreviewEntry","color","manifest","version","reactPeerRange","components","editor","previewComponents","previewCardGroups","title","showInitially","cards","entries","componentMetadata","attributeListForComponentTypes","componentNameToModifyAttribute","attributeEditModeConfigs","attributeTabName","heading","subHeading"],"mappings":"wCAQM,SAAUA,GAAkBC,iBAChCA,IAIA,MAAMC,EAAmBD,IAAmB,8BACtCE,GACyB,iBAArBD,GAAiCA,EAAiBE,OACtDF,OACAG,IAjBgB,8BAmBtB,OACEC,EAAA,MAAA,CACEC,MAAO,CACLC,QAAS,cACTC,UAAW,UACZC,SAEDJ,EAAA,IAAA,CACEC,MAAO,CACLI,OAAQ,EACRC,SAAU,SACVC,WAAY,IACZC,WAAY,KACbJ,SAEAP,KAIT,CCpCO,MCAMY,EAA4D,CACvEC,kBAAmB,uBCERC,EAA0C,CACrDC,GAAIH,EAAqBC,kBACzBG,KAAM,EACJlB,sBAGIK,EAACN,EAAiB,CAACC,iBAAkBA,IAC3CmB,uBFV6D,CAC7D,CACEC,KAAM,qCACNC,cAAe,CAAA,GAEjB,CACED,KAAM,qCACNC,cAAe,CAAA,GAEjB,CACED,KAAM,sCACNC,cAAe,CAAA,GAEjB,CACED,KAAM,6BACNC,cAAe,CAAA,GAEjB,CACED,KAAM,4BACNC,cAAe,CAAA,KGjBNC,EAAyC,CACpDL,GAAIH,EAAqBC,kBACzBG,KAAM,IACJb,EAAA,MAAA,CAAKC,MAAO,CAAEiB,MAAO,UAAWhB,QAAS,UAAWC,UAAW,UAAUC,SAAA,iCCgBtE,MAAMe,EAAW,CACtBP,GAAI,cACJQ,gBACAC,eAAgB,YAILC,EAAoD,CAC/D,CAACX,EAAiBC,IAAKD,GAIZY,EAAS,CACpBC,kBAAmB,CACjB,CAACP,EAAmBL,IAAKK,GAE3BQ,kBAAmB,CACjB,CACEC,MAAO,gBACPC,eAAe,EACfC,MAAO,CAAC,CAAEF,MAAO,gBAAiBG,QAAS,CAACZ,OAGhDa,kBAAmB,CACjBC,+BAAgC,CAAA,EAChCC,+BAAgC,CAAA,EAChCF,kBAAmB,CACjB,CAACrB,EAAqBC,mBAAoB,CACxCI,uBAAwBH,EAAiBG,uBACzCmB,yBClD2D,CACjE,CACElB,KAAM,6BACNmB,iBAAkB,OAClBC,QAAS,eACTC,WAAY,+DACZpB,cAAe,CAAA,GAEjB,CACED,KAAM,qCACNmB,iBAAkB,YAClBC,QAAS,uBACTC,WAAY,2DACZpB,cAAe,CAAA,GAEjB,CACED,KAAM,qCACNmB,iBAAkB,YAClBC,QAAS,uBACTC,WAAY,2DACZpB,cAAe,CAAA,GAEjB,CACED,KAAM,4BACNmB,iBAAkB,cAClBC,QAAS,cACTC,WAAY,mEACZpB,cAAe,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlfluidart/rulecms-widgets",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"description": "ATL Fluid Art's RuleCMS component library (customer zero of the multi-tenant component library architecture)",
|
|
6
|
+
"main": "dist/index.esm.js",
|
|
7
|
+
"module": "dist/index.esm.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.esm.js",
|
|
13
|
+
"require": "./dist/index.cjs",
|
|
14
|
+
"default": "./dist/index.esm.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"private": false,
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "rollup -c",
|
|
23
|
+
"dev": "rollup -c -w",
|
|
24
|
+
"test": "vitest run",
|
|
25
|
+
"test:watch": "vitest watch",
|
|
26
|
+
"typecheck": "tsc --noEmit",
|
|
27
|
+
"prepublishOnly": "npm run test && npm run typecheck && npm run build",
|
|
28
|
+
"version:patch": "npm version patch",
|
|
29
|
+
"version:minor": "npm version minor",
|
|
30
|
+
"version:major": "npm version major",
|
|
31
|
+
"release": "npm run test && npm run typecheck && npm run build && npm publish --access public"
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"rulecms",
|
|
35
|
+
"atlfluidart",
|
|
36
|
+
"components",
|
|
37
|
+
"react",
|
|
38
|
+
"cms"
|
|
39
|
+
],
|
|
40
|
+
"author": "RuleCMS, LLC",
|
|
41
|
+
"license": "UNLICENSED",
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"react": ">=16.8.0",
|
|
44
|
+
"react-dom": ">=16.8.0"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@rollup/plugin-commonjs": "^28.0.0",
|
|
48
|
+
"@rollup/plugin-json": "^6.0.0",
|
|
49
|
+
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
50
|
+
"@rollup/plugin-terser": "^0.4.0",
|
|
51
|
+
"@rollup/plugin-typescript": "^12.0.0",
|
|
52
|
+
"@rulecms/widget-react": "^15.0.0",
|
|
53
|
+
"@types/node": "^22.0.0",
|
|
54
|
+
"@types/react": "^18.0.0",
|
|
55
|
+
"@types/react-dom": "^18.0.0",
|
|
56
|
+
"@vitejs/plugin-react": "^4.0.0",
|
|
57
|
+
"jsdom": "^25.0.0",
|
|
58
|
+
"react": "^18.0.0",
|
|
59
|
+
"react-dom": "^18.0.0",
|
|
60
|
+
"rollup": "^4.0.0",
|
|
61
|
+
"rollup-plugin-dts": "^6.0.0",
|
|
62
|
+
"rollup-plugin-peer-deps-external": "^2.0.0",
|
|
63
|
+
"tslib": "^2.0.0",
|
|
64
|
+
"typescript": "^5.0.0",
|
|
65
|
+
"vite": "^5.0.0",
|
|
66
|
+
"vitest": "^2.1.3"
|
|
67
|
+
},
|
|
68
|
+
"publishConfig": {
|
|
69
|
+
"access": "public"
|
|
70
|
+
},
|
|
71
|
+
"engines": {
|
|
72
|
+
"node": ">=16.0.0"
|
|
73
|
+
}
|
|
74
|
+
}
|