@activecollab/components 2.0.409 → 2.0.410
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/cjs/components/BreakPoints.js +12 -1
- package/dist/cjs/components/BreakPoints.js.map +1 -1
- package/dist/cjs/components/Columns/Columns.js +42 -0
- package/dist/cjs/components/Columns/Columns.js.map +1 -0
- package/dist/cjs/components/Columns/Styles.js +25 -0
- package/dist/cjs/components/Columns/Styles.js.map +1 -0
- package/dist/cjs/components/Columns/index.js +17 -0
- package/dist/cjs/components/Columns/index.js.map +1 -0
- package/dist/cjs/components/LayoutTokens.js +21 -0
- package/dist/cjs/components/LayoutTokens.js.map +1 -0
- package/dist/cjs/components/Media/Media.js +39 -0
- package/dist/cjs/components/Media/Media.js.map +1 -0
- package/dist/cjs/components/Media/Styles.js +18 -0
- package/dist/cjs/components/Media/Styles.js.map +1 -0
- package/dist/cjs/components/Media/index.js +17 -0
- package/dist/cjs/components/Media/index.js.map +1 -0
- package/dist/cjs/components/PortableText/PortableText.js +125 -0
- package/dist/cjs/components/PortableText/PortableText.js.map +1 -0
- package/dist/cjs/components/PortableText/Styles.js +33 -0
- package/dist/cjs/components/PortableText/Styles.js.map +1 -0
- package/dist/cjs/components/PortableText/index.js +39 -0
- package/dist/cjs/components/PortableText/index.js.map +1 -0
- package/dist/cjs/components/PortableText/renderers.js +116 -0
- package/dist/cjs/components/PortableText/renderers.js.map +1 -0
- package/dist/cjs/components/PortableText/types.js +122 -0
- package/dist/cjs/components/PortableText/types.js.map +1 -0
- package/dist/cjs/components/PortableText/types.test.js +183 -0
- package/dist/cjs/components/PortableText/types.test.js.map +1 -0
- package/dist/cjs/components/Row/Row.js +30 -0
- package/dist/cjs/components/Row/Row.js.map +1 -0
- package/dist/cjs/components/Row/Styles.js +25 -0
- package/dist/cjs/components/Row/Styles.js.map +1 -0
- package/dist/cjs/components/Row/index.js +17 -0
- package/dist/cjs/components/Row/index.js.map +1 -0
- package/dist/cjs/components/Stack/Stack.js +27 -0
- package/dist/cjs/components/Stack/Stack.js.map +1 -0
- package/dist/cjs/components/Stack/Styles.js +21 -0
- package/dist/cjs/components/Stack/Styles.js.map +1 -0
- package/dist/cjs/components/Stack/index.js +17 -0
- package/dist/cjs/components/Stack/index.js.map +1 -0
- package/dist/cjs/components/Tiles/Styles.js +25 -0
- package/dist/cjs/components/Tiles/Styles.js.map +1 -0
- package/dist/cjs/components/Tiles/Tiles.js +29 -0
- package/dist/cjs/components/Tiles/Tiles.js.map +1 -0
- package/dist/cjs/components/Tiles/index.js +17 -0
- package/dist/cjs/components/Tiles/index.js.map +1 -0
- package/dist/cjs/components/TitledText/Styles.js +15 -0
- package/dist/cjs/components/TitledText/Styles.js.map +1 -0
- package/dist/cjs/components/TitledText/TitledText.js +50 -0
- package/dist/cjs/components/TitledText/TitledText.js.map +1 -0
- package/dist/cjs/components/TitledText/index.js +17 -0
- package/dist/cjs/components/TitledText/index.js.map +1 -0
- package/dist/cjs/components/index.js +88 -0
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/presentation/shared/MessageDialog.js +351 -0
- package/dist/cjs/presentation/shared/MessageDialog.js.map +1 -0
- package/dist/cjs/presentation/shared/index.js +22 -0
- package/dist/cjs/presentation/shared/index.js.map +1 -1
- package/dist/esm/components/BreakPoints.d.ts +2 -0
- package/dist/esm/components/BreakPoints.d.ts.map +1 -1
- package/dist/esm/components/BreakPoints.js +9 -0
- package/dist/esm/components/BreakPoints.js.map +1 -1
- package/dist/esm/components/Columns/Columns.d.ts +11 -0
- package/dist/esm/components/Columns/Columns.d.ts.map +1 -0
- package/dist/esm/components/Columns/Columns.js +34 -0
- package/dist/esm/components/Columns/Columns.js.map +1 -0
- package/dist/esm/components/Columns/Styles.d.ts +8 -0
- package/dist/esm/components/Columns/Styles.d.ts.map +1 -0
- package/dist/esm/components/Columns/Styles.js +18 -0
- package/dist/esm/components/Columns/Styles.js.map +1 -0
- package/dist/esm/components/Columns/index.d.ts +2 -0
- package/dist/esm/components/Columns/index.d.ts.map +1 -0
- package/dist/esm/components/Columns/index.js +2 -0
- package/dist/esm/components/Columns/index.js.map +1 -0
- package/dist/esm/components/LayoutTokens.d.ts +6 -0
- package/dist/esm/components/LayoutTokens.d.ts.map +1 -0
- package/dist/esm/components/LayoutTokens.js +15 -0
- package/dist/esm/components/LayoutTokens.js.map +1 -0
- package/dist/esm/components/Media/Media.d.ts +10 -0
- package/dist/esm/components/Media/Media.d.ts.map +1 -0
- package/dist/esm/components/Media/Media.js +31 -0
- package/dist/esm/components/Media/Media.js.map +1 -0
- package/dist/esm/components/Media/Styles.d.ts +4 -0
- package/dist/esm/components/Media/Styles.d.ts.map +1 -0
- package/dist/esm/components/Media/Styles.js +11 -0
- package/dist/esm/components/Media/Styles.js.map +1 -0
- package/dist/esm/components/Media/index.d.ts +2 -0
- package/dist/esm/components/Media/index.d.ts.map +1 -0
- package/dist/esm/components/Media/index.js +2 -0
- package/dist/esm/components/Media/index.js.map +1 -0
- package/dist/esm/components/PortableText/PortableText.d.ts +24 -0
- package/dist/esm/components/PortableText/PortableText.d.ts.map +1 -0
- package/dist/esm/components/PortableText/PortableText.js +111 -0
- package/dist/esm/components/PortableText/PortableText.js.map +1 -0
- package/dist/esm/components/PortableText/Styles.d.ts +9 -0
- package/dist/esm/components/PortableText/Styles.d.ts.map +1 -0
- package/dist/esm/components/PortableText/Styles.js +27 -0
- package/dist/esm/components/PortableText/Styles.js.map +1 -0
- package/dist/esm/components/PortableText/index.d.ts +4 -0
- package/dist/esm/components/PortableText/index.d.ts.map +1 -0
- package/dist/esm/components/PortableText/index.js +4 -0
- package/dist/esm/components/PortableText/index.js.map +1 -0
- package/dist/esm/components/PortableText/renderers.d.ts +9 -0
- package/dist/esm/components/PortableText/renderers.d.ts.map +1 -0
- package/dist/esm/components/PortableText/renderers.js +110 -0
- package/dist/esm/components/PortableText/renderers.js.map +1 -0
- package/dist/esm/components/PortableText/types.d.ts +141 -0
- package/dist/esm/components/PortableText/types.d.ts.map +1 -0
- package/dist/esm/components/PortableText/types.js +106 -0
- package/dist/esm/components/PortableText/types.js.map +1 -0
- package/dist/esm/components/PortableText/types.test.d.ts +2 -0
- package/dist/esm/components/PortableText/types.test.d.ts.map +1 -0
- package/dist/esm/components/PortableText/types.test.js +181 -0
- package/dist/esm/components/PortableText/types.test.js.map +1 -0
- package/dist/esm/components/Row/Row.d.ts +10 -0
- package/dist/esm/components/Row/Row.d.ts.map +1 -0
- package/dist/esm/components/Row/Row.js +22 -0
- package/dist/esm/components/Row/Row.js.map +1 -0
- package/dist/esm/components/Row/Styles.d.ts +8 -0
- package/dist/esm/components/Row/Styles.d.ts.map +1 -0
- package/dist/esm/components/Row/Styles.js +18 -0
- package/dist/esm/components/Row/Styles.js.map +1 -0
- package/dist/esm/components/Row/index.d.ts +2 -0
- package/dist/esm/components/Row/index.d.ts.map +1 -0
- package/dist/esm/components/Row/index.js +2 -0
- package/dist/esm/components/Row/index.js.map +1 -0
- package/dist/esm/components/Stack/Stack.d.ts +8 -0
- package/dist/esm/components/Stack/Stack.d.ts.map +1 -0
- package/dist/esm/components/Stack/Stack.js +19 -0
- package/dist/esm/components/Stack/Stack.js.map +1 -0
- package/dist/esm/components/Stack/Styles.d.ts +6 -0
- package/dist/esm/components/Stack/Styles.d.ts.map +1 -0
- package/dist/esm/components/Stack/Styles.js +14 -0
- package/dist/esm/components/Stack/Styles.js.map +1 -0
- package/dist/esm/components/Stack/index.d.ts +2 -0
- package/dist/esm/components/Stack/index.d.ts.map +1 -0
- package/dist/esm/components/Stack/index.js +2 -0
- package/dist/esm/components/Stack/index.js.map +1 -0
- package/dist/esm/components/Tiles/Styles.d.ts +8 -0
- package/dist/esm/components/Tiles/Styles.d.ts.map +1 -0
- package/dist/esm/components/Tiles/Styles.js +18 -0
- package/dist/esm/components/Tiles/Styles.js.map +1 -0
- package/dist/esm/components/Tiles/Tiles.d.ts +10 -0
- package/dist/esm/components/Tiles/Tiles.d.ts.map +1 -0
- package/dist/esm/components/Tiles/Tiles.js +21 -0
- package/dist/esm/components/Tiles/Tiles.js.map +1 -0
- package/dist/esm/components/Tiles/index.d.ts +2 -0
- package/dist/esm/components/Tiles/index.d.ts.map +1 -0
- package/dist/esm/components/Tiles/index.js +2 -0
- package/dist/esm/components/Tiles/index.js.map +1 -0
- package/dist/esm/components/TitledText/Styles.d.ts +2 -0
- package/dist/esm/components/TitledText/Styles.d.ts.map +1 -0
- package/dist/esm/components/TitledText/Styles.js +8 -0
- package/dist/esm/components/TitledText/Styles.js.map +1 -0
- package/dist/esm/components/TitledText/TitledText.d.ts +18 -0
- package/dist/esm/components/TitledText/TitledText.d.ts.map +1 -0
- package/dist/esm/components/TitledText/TitledText.js +43 -0
- package/dist/esm/components/TitledText/TitledText.js.map +1 -0
- package/dist/esm/components/TitledText/index.d.ts +2 -0
- package/dist/esm/components/TitledText/index.d.ts.map +1 -0
- package/dist/esm/components/TitledText/index.js +2 -0
- package/dist/esm/components/TitledText/index.js.map +1 -0
- package/dist/esm/components/index.d.ts +8 -0
- package/dist/esm/components/index.d.ts.map +1 -1
- package/dist/esm/components/index.js +8 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/presentation/shared/MessageDialog.d.ts +35 -0
- package/dist/esm/presentation/shared/MessageDialog.d.ts.map +1 -0
- package/dist/esm/presentation/shared/MessageDialog.js +331 -0
- package/dist/esm/presentation/shared/MessageDialog.js.map +1 -0
- package/dist/esm/presentation/shared/index.d.ts +2 -0
- package/dist/esm/presentation/shared/index.d.ts.map +1 -1
- package/dist/esm/presentation/shared/index.js +1 -0
- package/dist/esm/presentation/shared/index.js.map +1 -1
- package/dist/index.js +1355 -742
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.portableTextDefaultMarkRenderers = exports.portableTextDefaultBlockRenderers = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _Styles = require("./Styles");
|
|
9
|
+
var _Media = require("../Media");
|
|
10
|
+
var _TitledText = require("../TitledText");
|
|
11
|
+
var _Typography = require("../Typography");
|
|
12
|
+
var _Typography2 = require("../Typography/Typography");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
/**
|
|
15
|
+
* The default renderers for the universal set — everything a client renders
|
|
16
|
+
* without injection, and nothing more: no product element ever lands here.
|
|
17
|
+
* Injected {@link PortableTextComponents} maps take precedence entry by entry.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
var portableTextDefaultMarkRenderers = exports.portableTextDefaultMarkRenderers = {
|
|
21
|
+
strong: function strong(_ref) {
|
|
22
|
+
var children = _ref.children;
|
|
23
|
+
return /*#__PURE__*/_react.default.createElement("strong", null, children);
|
|
24
|
+
},
|
|
25
|
+
em: function em(_ref2) {
|
|
26
|
+
var children = _ref2.children;
|
|
27
|
+
return /*#__PURE__*/_react.default.createElement("em", null, children);
|
|
28
|
+
},
|
|
29
|
+
code: function code(_ref3) {
|
|
30
|
+
var children = _ref3.children;
|
|
31
|
+
return /*#__PURE__*/_react.default.createElement(_Styles.StyledCode, null, children);
|
|
32
|
+
},
|
|
33
|
+
link: function link(_ref4) {
|
|
34
|
+
var mark = _ref4.mark,
|
|
35
|
+
children = _ref4.children;
|
|
36
|
+
var href = mark === null || mark === void 0 ? void 0 : mark.href;
|
|
37
|
+
|
|
38
|
+
// A link mark without an href (authored as a plain string) has nowhere
|
|
39
|
+
// to go — keep the text, skip the anchor.
|
|
40
|
+
if (!href) {
|
|
41
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children);
|
|
42
|
+
}
|
|
43
|
+
return /*#__PURE__*/_react.default.createElement(_Styles.StyledLink, {
|
|
44
|
+
href: href,
|
|
45
|
+
target: "_blank",
|
|
46
|
+
rel: "noopener noreferrer"
|
|
47
|
+
}, children);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** The semantic wire levels resolve to typography only here, in the renderer. */
|
|
52
|
+
var HEADING_LEVEL_VARIANTS = {
|
|
53
|
+
1: "title1",
|
|
54
|
+
2: "title2",
|
|
55
|
+
3: "header2"
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/** Heading levels map to the same typography TitledText uses. */
|
|
59
|
+
var HeadingBlock = function HeadingBlock(_ref5) {
|
|
60
|
+
var _HEADING_LEVEL_VARIAN;
|
|
61
|
+
var block = _ref5.block,
|
|
62
|
+
children = _ref5.children;
|
|
63
|
+
var _ref6 = block,
|
|
64
|
+
level = _ref6.level;
|
|
65
|
+
var Heading = _TitledText.titledTextHeadings[(_HEADING_LEVEL_VARIAN = HEADING_LEVEL_VARIANTS[level]) !== null && _HEADING_LEVEL_VARIAN !== void 0 ? _HEADING_LEVEL_VARIAN : "header2"];
|
|
66
|
+
return /*#__PURE__*/_react.default.createElement(Heading, null, children);
|
|
67
|
+
};
|
|
68
|
+
var portableTextDefaultBlockRenderers = exports.portableTextDefaultBlockRenderers = {
|
|
69
|
+
paragraph: function paragraph(_ref7) {
|
|
70
|
+
var children = _ref7.children;
|
|
71
|
+
return /*#__PURE__*/_react.default.createElement(_Typography.Body1, null, children);
|
|
72
|
+
},
|
|
73
|
+
heading: HeadingBlock,
|
|
74
|
+
list: function list(_ref8) {
|
|
75
|
+
var block = _ref8.block,
|
|
76
|
+
children = _ref8.children;
|
|
77
|
+
var ordered = block.style === "number";
|
|
78
|
+
return /*#__PURE__*/_react.default.createElement(_Styles.StyledList, {
|
|
79
|
+
as: ordered ? "ol" : "ul",
|
|
80
|
+
$ordered: ordered
|
|
81
|
+
}, children);
|
|
82
|
+
},
|
|
83
|
+
"list-item": function listItem(_ref9) {
|
|
84
|
+
var children = _ref9.children;
|
|
85
|
+
return /*#__PURE__*/_react.default.createElement(_Typography2.Typography, {
|
|
86
|
+
variant: "Body 1",
|
|
87
|
+
as: "li"
|
|
88
|
+
}, children);
|
|
89
|
+
},
|
|
90
|
+
media: function media(_ref0) {
|
|
91
|
+
var block = _ref0.block;
|
|
92
|
+
var _ref1 = block,
|
|
93
|
+
src = _ref1.src,
|
|
94
|
+
alt = _ref1.alt,
|
|
95
|
+
variant = _ref1.variant,
|
|
96
|
+
caption = _ref1.caption;
|
|
97
|
+
return /*#__PURE__*/_react.default.createElement(_Media.Media, {
|
|
98
|
+
src: src,
|
|
99
|
+
alt: alt,
|
|
100
|
+
variant: variant,
|
|
101
|
+
caption: caption
|
|
102
|
+
});
|
|
103
|
+
},
|
|
104
|
+
"titled-text": function titledText(_ref10) {
|
|
105
|
+
var block = _ref10.block,
|
|
106
|
+
children = _ref10.children;
|
|
107
|
+
var _ref11 = block,
|
|
108
|
+
title = _ref11.title,
|
|
109
|
+
level = _ref11.level;
|
|
110
|
+
return /*#__PURE__*/_react.default.createElement(_TitledText.TitledText, {
|
|
111
|
+
title: title,
|
|
112
|
+
variant: HEADING_LEVEL_VARIANTS[level !== null && level !== void 0 ? level : 3]
|
|
113
|
+
}, children);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
//# sourceMappingURL=renderers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderers.js","names":["_react","_interopRequireDefault","require","_Styles","_Media","_TitledText","_Typography","_Typography2","e","__esModule","default","portableTextDefaultMarkRenderers","exports","strong","_ref","children","createElement","em","_ref2","code","_ref3","StyledCode","link","_ref4","mark","href","Fragment","StyledLink","target","rel","HEADING_LEVEL_VARIANTS","HeadingBlock","_ref5","_HEADING_LEVEL_VARIAN","block","_ref6","level","Heading","titledTextHeadings","portableTextDefaultBlockRenderers","paragraph","_ref7","Body1","heading","list","_ref8","ordered","style","StyledList","as","$ordered","listItem","_ref9","Typography","variant","media","_ref0","_ref1","src","alt","caption","Media","titledText","_ref10","_ref11","title","TitledText"],"sources":["../../../../src/components/PortableText/renderers.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { StyledCode, StyledLink, StyledList } from \"./Styles\";\nimport {\n PortableTextBlockRenderer,\n PortableTextDefaultBlockType,\n PortableTextDefaultMark,\n PortableTextHeadingBlock,\n PortableTextHeadingLevel,\n PortableTextLinkMark,\n PortableTextListBlock,\n PortableTextMarkRenderer,\n PortableTextMediaBlock,\n PortableTextTitledTextBlock,\n} from \"./types\";\nimport { Media } from \"../Media\";\nimport {\n TitledText,\n TitledTextVariant,\n titledTextHeadings,\n} from \"../TitledText\";\nimport { Body1 } from \"../Typography\";\nimport { Typography } from \"../Typography/Typography\";\n\n/**\n * The default renderers for the universal set — everything a client renders\n * without injection, and nothing more: no product element ever lands here.\n * Injected {@link PortableTextComponents} maps take precedence entry by entry.\n */\n\nexport const portableTextDefaultMarkRenderers: Record<\n PortableTextDefaultMark,\n PortableTextMarkRenderer\n> = {\n strong: ({ children }) => <strong>{children}</strong>,\n em: ({ children }) => <em>{children}</em>,\n code: ({ children }) => <StyledCode>{children}</StyledCode>,\n link: ({ mark, children }) => {\n const href = (mark as PortableTextLinkMark | undefined)?.href;\n\n // A link mark without an href (authored as a plain string) has nowhere\n // to go — keep the text, skip the anchor.\n if (!href) {\n return <>{children}</>;\n }\n\n return (\n <StyledLink href={href} target=\"_blank\" rel=\"noopener noreferrer\">\n {children}\n </StyledLink>\n );\n },\n};\n\n/** The semantic wire levels resolve to typography only here, in the renderer. */\nconst HEADING_LEVEL_VARIANTS: Record<\n PortableTextHeadingLevel,\n TitledTextVariant\n> = {\n 1: \"title1\",\n 2: \"title2\",\n 3: \"header2\",\n};\n\n/** Heading levels map to the same typography TitledText uses. */\nconst HeadingBlock: PortableTextBlockRenderer = ({ block, children }) => {\n const { level } = block as PortableTextHeadingBlock;\n const Heading =\n titledTextHeadings[HEADING_LEVEL_VARIANTS[level] ?? \"header2\"];\n return <Heading>{children}</Heading>;\n};\n\nexport const portableTextDefaultBlockRenderers: Record<\n PortableTextDefaultBlockType,\n PortableTextBlockRenderer\n> = {\n paragraph: ({ children }) => <Body1>{children}</Body1>,\n heading: HeadingBlock,\n list: ({ block, children }) => {\n const ordered = (block as PortableTextListBlock).style === \"number\";\n return (\n <StyledList as={ordered ? \"ol\" : \"ul\"} $ordered={ordered}>\n {children}\n </StyledList>\n );\n },\n \"list-item\": ({ children }) => (\n <Typography variant=\"Body 1\" as=\"li\">\n {children}\n </Typography>\n ),\n media: ({ block }) => {\n const { src, alt, variant, caption } = block as PortableTextMediaBlock;\n return <Media src={src} alt={alt} variant={variant} caption={caption} />;\n },\n \"titled-text\": ({ block, children }) => {\n const { title, level } = block as PortableTextTitledTextBlock;\n return (\n <TitledText title={title} variant={HEADING_LEVEL_VARIANTS[level ?? 3]}>\n {children}\n </TitledText>\n );\n },\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAaA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAAsD,SAAAD,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEtD;AACA;AACA;AACA;AACA;;AAEO,IAAMG,gCAGZ,GAAAC,OAAA,CAAAD,gCAAA,GAAG;EACFE,MAAM,EAAE,SAARA,MAAMA,CAAAC,IAAA;IAAA,IAAKC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAA,oBAAOf,MAAA,CAAAU,OAAA,CAAAM,aAAA,iBAASD,QAAiB,CAAC;EAAA;EACrDE,EAAE,EAAE,SAAJA,EAAEA,CAAAC,KAAA;IAAA,IAAKH,QAAQ,GAAAG,KAAA,CAARH,QAAQ;IAAA,oBAAOf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,GAAAD,KAAA,CAAHC,GAAG;MAAEC,GAAG,GAAAF,KAAA,CAAHE,GAAG;MAAEL,OAAO,GAAAG,KAAA,CAAPH,OAAO;MAAEM,OAAO,GAAAH,KAAA,CAAPG,OAAO;IAClC,oBAAO5D,MAAA,CAAAU,OAAA,CAAAM,aAAA,CAACZ,MAAA,CAAAyD,KAAK;MAACH,GAAG,EAAEA,GAAI;MAACC,GAAG,EAAEA,GAAI;MAACL,OAAO,EAAEA,OAAQ;MAACM,OAAO,EAAEA;IAAQ,CAAE,CAAC;EAC1E,CAAC;EACD,aAAa,EAAE,SAAfE,UAAaA,CAAAC,MAAA,EAA2B;IAAA,IAAtB7B,KAAK,GAAA6B,MAAA,CAAL7B,KAAK;MAAEnB,QAAQ,GAAAgD,MAAA,CAARhD,QAAQ;IAC/B,IAAAiD,MAAA,GAAyB9B,KAAK;MAAtB+B,KAAK,GAAAD,MAAA,CAALC,KAAK;MAAE7B,KAAK,GAAA4B,MAAA,CAAL5B,KAAK;IACpB,oBACEpC,MAAA,CAAAU,OAAA,CAAAM,aAAA,CAACX,WAAA,CAAA6D,UAAU;MAACD,KAAK,EAAEA,KAAM;MAACX,OAAO,EAAExB,sBAAsB,CAACM,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,CAAC;IAAE,GACnErB,QACS,CAAC;EAEjB;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isPortableTextSpan = exports.isPortableTextObjectNode = exports.isPortableTextContent = exports.isPortableTextBlock = exports.PORTABLE_TEXT_DEFAULT_MARKS = exports.PORTABLE_TEXT_DEFAULT_BLOCKS = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Portable Text envelope — the general content contract for structured,
|
|
9
|
+
* renderer-independent content (in-app messages, help, changelogs).
|
|
10
|
+
*
|
|
11
|
+
* The design system owns this envelope and the universal default set below.
|
|
12
|
+
* It never hardcodes a product element: concrete elements (callout,
|
|
13
|
+
* button-reference, doc-link, …) are defined in the application catalog and
|
|
14
|
+
* injected into the Portable Text engine through {@link PortableTextComponents}.
|
|
15
|
+
* See README.md next to this file for the full contract.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/* ---- Spans and marks ------------------------------------------------- */
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A mark with data. Parameterless marks travel as plain strings ("strong");
|
|
22
|
+
* marks that need data travel as objects discriminated by `type`.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/** The one default mark that carries data. */
|
|
26
|
+
|
|
27
|
+
/** The leaf of every text run: a piece of text plus the marks wrapping it. */
|
|
28
|
+
|
|
29
|
+
/** Marks every client understands without injection. */
|
|
30
|
+
var PORTABLE_TEXT_DEFAULT_MARKS = exports.PORTABLE_TEXT_DEFAULT_MARKS = ["strong", "em", "code", "link"];
|
|
31
|
+
|
|
32
|
+
/* ---- Blocks ----------------------------------------------------------- */
|
|
33
|
+
|
|
34
|
+
/** 1 maps to Title1, 2 to Title2, 3 to Header2 typography. */
|
|
35
|
+
|
|
36
|
+
/** Screenshots render framed (border, no shadow); illustrations render flat. */
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Derived from the union's discriminators, so adding a block to the union
|
|
40
|
+
* without a renderer entry is a compile error, never silent drift.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
// A Record so the compiler checks the list against the union in both
|
|
44
|
+
// directions: a missing and a stray key each fail to build.
|
|
45
|
+
var DEFAULT_BLOCK_TYPES = {
|
|
46
|
+
paragraph: true,
|
|
47
|
+
heading: true,
|
|
48
|
+
list: true,
|
|
49
|
+
"list-item": true,
|
|
50
|
+
media: true,
|
|
51
|
+
"titled-text": true
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** Blocks every client understands without injection. */
|
|
55
|
+
var PORTABLE_TEXT_DEFAULT_BLOCKS = exports.PORTABLE_TEXT_DEFAULT_BLOCKS = Object.keys(DEFAULT_BLOCK_TYPES);
|
|
56
|
+
|
|
57
|
+
/* ---- Objects ----------------------------------------------------------- */
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* An embedded component the envelope does not interpret: `_type` names an
|
|
61
|
+
* application-catalog element, everything else is that element's data. An
|
|
62
|
+
* object whose `_type` has no injected renderer renders nothing and is logged.
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
/** The root of a message body: what an API returns under `content`. */
|
|
66
|
+
|
|
67
|
+
/* ---- Injection contract ------------------------------------------------ */
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Called once per unknown type instead of rendering it, so content written
|
|
71
|
+
* for newer clients degrades silently on older ones.
|
|
72
|
+
*/
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* What an application injects into the Portable Text engine: renderers for
|
|
76
|
+
* its catalog marks and objects, optional overrides for the default blocks,
|
|
77
|
+
* and the unknown-type hook.
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
/* ---- Runtime guards ----------------------------------------------------- */
|
|
81
|
+
|
|
82
|
+
var isRecord = function isRecord(value) {
|
|
83
|
+
return typeof value === "object" && value !== null;
|
|
84
|
+
};
|
|
85
|
+
var isPortableTextSpan = exports.isPortableTextSpan = function isPortableTextSpan(value) {
|
|
86
|
+
return isRecord(value) && typeof value.text === "string";
|
|
87
|
+
};
|
|
88
|
+
var isPortableTextObjectNode = exports.isPortableTextObjectNode = function isPortableTextObjectNode(value) {
|
|
89
|
+
return isRecord(value) && value.type === "object" && typeof value._type === "string";
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* A block is any non-object node with a string `type`. Unknown block types
|
|
94
|
+
* stay valid on purpose — they render nothing on clients that predate them.
|
|
95
|
+
* Known types are held to their shape, so a serializer bug (a paragraph
|
|
96
|
+
* without `children`, a list of non-nodes) fails here instead of at render.
|
|
97
|
+
*/
|
|
98
|
+
var _isPortableTextBlock = exports.isPortableTextBlock = function isPortableTextBlock(value) {
|
|
99
|
+
if (!isRecord(value) || typeof value.type !== "string" || value.type === "object") {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
switch (value.type) {
|
|
103
|
+
case "paragraph":
|
|
104
|
+
case "heading":
|
|
105
|
+
case "list-item":
|
|
106
|
+
return Array.isArray(value.children) && value.children.every(isPortableTextSpan);
|
|
107
|
+
case "list":
|
|
108
|
+
return Array.isArray(value.children) && value.children.every(_isPortableTextBlock);
|
|
109
|
+
case "media":
|
|
110
|
+
return typeof value.src === "string";
|
|
111
|
+
case "titled-text":
|
|
112
|
+
return typeof value.title === "string" && (value.content === undefined || isPortableTextContent(value.content));
|
|
113
|
+
default:
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
var isPortableTextContent = exports.isPortableTextContent = function isPortableTextContent(value) {
|
|
118
|
+
return Array.isArray(value) && value.every(function (node) {
|
|
119
|
+
return _isPortableTextBlock(node) || isPortableTextObjectNode(node);
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":["PORTABLE_TEXT_DEFAULT_MARKS","exports","DEFAULT_BLOCK_TYPES","paragraph","heading","list","media","PORTABLE_TEXT_DEFAULT_BLOCKS","Object","keys","isRecord","value","isPortableTextSpan","text","isPortableTextObjectNode","type","_type","isPortableTextBlock","Array","isArray","children","every","src","title","content","undefined","isPortableTextContent","node"],"sources":["../../../../src/components/PortableText/types.ts"],"sourcesContent":["import { ComponentType, ReactNode } from \"react\";\n\n/**\n * Portable Text envelope — the general content contract for structured,\n * renderer-independent content (in-app messages, help, changelogs).\n *\n * The design system owns this envelope and the universal default set below.\n * It never hardcodes a product element: concrete elements (callout,\n * button-reference, doc-link, …) are defined in the application catalog and\n * injected into the Portable Text engine through {@link PortableTextComponents}.\n * See README.md next to this file for the full contract.\n */\n\n/* ---- Spans and marks ------------------------------------------------- */\n\n/**\n * A mark with data. Parameterless marks travel as plain strings (\"strong\");\n * marks that need data travel as objects discriminated by `type`.\n */\nexport interface PortableTextMarkObject {\n type: string;\n [data: string]: unknown;\n}\n\n/** The one default mark that carries data. */\nexport interface PortableTextLinkMark extends PortableTextMarkObject {\n type: \"link\";\n href: string;\n}\n\nexport type PortableTextMark = string | PortableTextMarkObject;\n\n/** The leaf of every text run: a piece of text plus the marks wrapping it. */\nexport interface PortableTextSpan {\n text: string;\n marks?: PortableTextMark[];\n}\n\n/** Marks every client understands without injection. */\nexport const PORTABLE_TEXT_DEFAULT_MARKS = [\n \"strong\",\n \"em\",\n \"code\",\n \"link\",\n] as const;\n\nexport type PortableTextDefaultMark =\n (typeof PORTABLE_TEXT_DEFAULT_MARKS)[number];\n\n/* ---- Blocks ----------------------------------------------------------- */\n\nexport interface PortableTextParagraphBlock {\n type: \"paragraph\";\n children: PortableTextSpan[];\n}\n\n/** 1 maps to Title1, 2 to Title2, 3 to Header2 typography. */\nexport type PortableTextHeadingLevel = 1 | 2 | 3;\n\nexport interface PortableTextHeadingBlock {\n type: \"heading\";\n level: PortableTextHeadingLevel;\n children: PortableTextSpan[];\n}\n\nexport type PortableTextListStyle = \"bullet\" | \"number\";\n\nexport interface PortableTextListItemBlock {\n type: \"list-item\";\n children: PortableTextSpan[];\n}\n\nexport interface PortableTextListBlock {\n type: \"list\";\n style?: PortableTextListStyle;\n children: PortableTextListItemBlock[];\n}\n\n/** Screenshots render framed (border, no shadow); illustrations render flat. */\nexport type PortableTextMediaVariant = \"screenshot\" | \"illustration\";\n\nexport interface PortableTextMediaBlock {\n type: \"media\";\n src: string;\n alt?: string;\n variant?: PortableTextMediaVariant;\n caption?: string;\n}\n\nexport interface PortableTextTitledTextBlock {\n type: \"titled-text\";\n /**\n * Same semantic scale as `heading` — 1, 2 or 3 (the default) — so the wire\n * format never encodes a typography name. How a level looks is the\n * renderer's business.\n */\n level?: PortableTextHeadingLevel;\n title: string;\n content?: PortableTextNode[];\n}\n\nexport type PortableTextBlock =\n | PortableTextParagraphBlock\n | PortableTextHeadingBlock\n | PortableTextListBlock\n | PortableTextMediaBlock\n | PortableTextTitledTextBlock;\n\n/**\n * Derived from the union's discriminators, so adding a block to the union\n * without a renderer entry is a compile error, never silent drift.\n */\nexport type PortableTextDefaultBlockType = (\n | PortableTextBlock\n | PortableTextListItemBlock\n)[\"type\"];\n\n// A Record so the compiler checks the list against the union in both\n// directions: a missing and a stray key each fail to build.\nconst DEFAULT_BLOCK_TYPES: Record<PortableTextDefaultBlockType, true> = {\n paragraph: true,\n heading: true,\n list: true,\n \"list-item\": true,\n media: true,\n \"titled-text\": true,\n};\n\n/** Blocks every client understands without injection. */\nexport const PORTABLE_TEXT_DEFAULT_BLOCKS = Object.keys(\n DEFAULT_BLOCK_TYPES\n) as readonly PortableTextDefaultBlockType[];\n\n/* ---- Objects ----------------------------------------------------------- */\n\n/**\n * An embedded component the envelope does not interpret: `_type` names an\n * application-catalog element, everything else is that element's data. An\n * object whose `_type` has no injected renderer renders nothing and is logged.\n */\nexport interface PortableTextObjectNode {\n type: \"object\";\n _type: string;\n [data: string]: unknown;\n}\n\nexport type PortableTextNode = PortableTextBlock | PortableTextObjectNode;\n\n/** The root of a message body: what an API returns under `content`. */\nexport type PortableTextContent = PortableTextNode[];\n\n/* ---- Injection contract ------------------------------------------------ */\n\nexport interface PortableTextMarkRendererProps<\n TMark extends PortableTextMarkObject = PortableTextMarkObject\n> {\n /** Present for object marks; absent when the mark is a plain string. */\n mark?: TMark;\n children: ReactNode;\n}\n\nexport type PortableTextMarkRenderer<\n TMark extends PortableTextMarkObject = PortableTextMarkObject\n> = ComponentType<PortableTextMarkRendererProps<TMark>>;\n\nexport interface PortableTextObjectRendererProps<\n TNode extends PortableTextObjectNode = PortableTextObjectNode\n> {\n node: TNode;\n /** The object's nested `content`, already rendered by the engine. */\n children?: ReactNode;\n}\n\nexport type PortableTextObjectRenderer<\n TNode extends PortableTextObjectNode = PortableTextObjectNode\n> = ComponentType<PortableTextObjectRendererProps<TNode>>;\n\nexport interface PortableTextBlockRendererProps<\n TBlock extends PortableTextBlock = PortableTextBlock\n> {\n block: TBlock;\n /** The block's rendered children/content, when it has any. */\n children?: ReactNode;\n}\n\nexport type PortableTextBlockRenderer<\n TBlock extends PortableTextBlock = PortableTextBlock\n> = ComponentType<PortableTextBlockRendererProps<TBlock>>;\n\nexport type PortableTextUnknownKind = \"block\" | \"mark\" | \"object\";\n\n/**\n * Called once per unknown type instead of rendering it, so content written\n * for newer clients degrades silently on older ones.\n */\nexport type PortableTextUnknownTypeHandler = (\n kind: PortableTextUnknownKind,\n type: string\n) => void;\n\n/**\n * What an application injects into the Portable Text engine: renderers for\n * its catalog marks and objects, optional overrides for the default blocks,\n * and the unknown-type hook.\n */\nexport interface PortableTextComponents {\n marks?: Record<string, PortableTextMarkRenderer>;\n objects?: Record<string, PortableTextObjectRenderer>;\n blocks?: Partial<\n Record<PortableTextDefaultBlockType, PortableTextBlockRenderer>\n >;\n onUnknownType?: PortableTextUnknownTypeHandler;\n}\n\n/* ---- Runtime guards ----------------------------------------------------- */\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null;\n\nexport const isPortableTextSpan = (value: unknown): value is PortableTextSpan =>\n isRecord(value) && typeof value.text === \"string\";\n\nexport const isPortableTextObjectNode = (\n value: unknown\n): value is PortableTextObjectNode =>\n isRecord(value) && value.type === \"object\" && typeof value._type === \"string\";\n\n/**\n * A block is any non-object node with a string `type`. Unknown block types\n * stay valid on purpose — they render nothing on clients that predate them.\n * Known types are held to their shape, so a serializer bug (a paragraph\n * without `children`, a list of non-nodes) fails here instead of at render.\n */\nexport const isPortableTextBlock = (\n value: unknown\n): value is PortableTextBlock => {\n if (\n !isRecord(value) ||\n typeof value.type !== \"string\" ||\n value.type === \"object\"\n ) {\n return false;\n }\n\n switch (value.type) {\n case \"paragraph\":\n case \"heading\":\n case \"list-item\":\n return (\n Array.isArray(value.children) &&\n value.children.every(isPortableTextSpan)\n );\n case \"list\":\n return (\n Array.isArray(value.children) &&\n value.children.every(isPortableTextBlock)\n );\n case \"media\":\n return typeof value.src === \"string\";\n case \"titled-text\":\n return (\n typeof value.title === \"string\" &&\n (value.content === undefined || isPortableTextContent(value.content))\n );\n default:\n return true;\n }\n};\n\nexport const isPortableTextContent = (\n value: unknown\n): value is PortableTextContent =>\n Array.isArray(value) &&\n value.every(\n (node) => isPortableTextBlock(node) || isPortableTextObjectNode(node)\n );\n"],"mappings":";;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAMA;;AAQA;;AAMA;AACO,IAAMA,2BAA2B,GAAAC,OAAA,CAAAD,2BAAA,GAAG,CACzC,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,MAAM,CACE;;AAKV;;AAOA;;AAsBA;;AA8BA;AACA;AACA;AACA;;AAMA;AACA;AACA,IAAME,mBAA+D,GAAG;EACtEC,SAAS,EAAE,IAAI;EACfC,OAAO,EAAE,IAAI;EACbC,IAAI,EAAE,IAAI;EACV,WAAW,EAAE,IAAI;EACjBC,KAAK,EAAE,IAAI;EACX,aAAa,EAAE;AACjB,CAAC;;AAED;AACO,IAAMC,4BAA4B,GAAAN,OAAA,CAAAM,4BAAA,GAAGC,MAAM,CAACC,IAAI,CACrDP,mBACF,CAA4C;;AAE5C;;AAEA;AACA;AACA;AACA;AACA;;AASA;;AAGA;;AAwCA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;;AAUA;;AAEA,IAAMQ,QAAQ,GAAG,SAAXA,QAAQA,CAAIC,KAAc;EAAA,OAC9B,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,KAAK,IAAI;AAAA;AAEtC,IAAMC,kBAAkB,GAAAX,OAAA,CAAAW,kBAAA,GAAG,SAArBA,kBAAkBA,CAAID,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AAAzB,OAAA,CAAAyB,qBAAA,GAAG,SAAxBA,qBAAqBA,CAChCf,KAAc;EAAA,OAEdO,KAAK,CAACC,OAAO,CAACR,KAAK,CAAC,IACpBA,KAAK,CAACU,KAAK,CACT,UAACM,IAAI;IAAA,OAAKV,oBAAmB,CAACU,IAAI,CAAC,IAAIb,wBAAwB,CAACa,IAAI,CAAC;EAAA,CACvE,CAAC;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _react = require("react");
|
|
4
|
+
var _types = require("./types");
|
|
5
|
+
describe("PortableText envelope", function () {
|
|
6
|
+
var sampleMessageContent = [{
|
|
7
|
+
type: "heading",
|
|
8
|
+
level: 2,
|
|
9
|
+
children: [{
|
|
10
|
+
text: "IP Firewall"
|
|
11
|
+
}]
|
|
12
|
+
}, {
|
|
13
|
+
type: "paragraph",
|
|
14
|
+
children: [{
|
|
15
|
+
text: "Open the "
|
|
16
|
+
}, {
|
|
17
|
+
text: "Security page",
|
|
18
|
+
marks: ["interface-name"]
|
|
19
|
+
}, {
|
|
20
|
+
text: " and press "
|
|
21
|
+
}, {
|
|
22
|
+
text: "Enter",
|
|
23
|
+
marks: ["keyboard-key"]
|
|
24
|
+
}, {
|
|
25
|
+
text: ". Read more in "
|
|
26
|
+
}, {
|
|
27
|
+
text: "the help article",
|
|
28
|
+
marks: [{
|
|
29
|
+
type: "doc-link",
|
|
30
|
+
article: "ip-firewall"
|
|
31
|
+
}]
|
|
32
|
+
}, {
|
|
33
|
+
text: "."
|
|
34
|
+
}]
|
|
35
|
+
}, {
|
|
36
|
+
type: "list",
|
|
37
|
+
style: "bullet",
|
|
38
|
+
children: [{
|
|
39
|
+
type: "list-item",
|
|
40
|
+
children: [{
|
|
41
|
+
text: "Allowlist the IPs you trust"
|
|
42
|
+
}]
|
|
43
|
+
}, {
|
|
44
|
+
type: "list-item",
|
|
45
|
+
children: [{
|
|
46
|
+
text: "immediately",
|
|
47
|
+
marks: ["strong"]
|
|
48
|
+
}]
|
|
49
|
+
}]
|
|
50
|
+
}, {
|
|
51
|
+
type: "media",
|
|
52
|
+
src: "/screenshots/firewall.png",
|
|
53
|
+
variant: "screenshot",
|
|
54
|
+
caption: "The firewall settings"
|
|
55
|
+
}, {
|
|
56
|
+
type: "titled-text",
|
|
57
|
+
title: "Allowlist the IPs you trust",
|
|
58
|
+
level: 3,
|
|
59
|
+
content: [{
|
|
60
|
+
type: "paragraph",
|
|
61
|
+
children: [{
|
|
62
|
+
text: "Add one range per line."
|
|
63
|
+
}]
|
|
64
|
+
}]
|
|
65
|
+
}, {
|
|
66
|
+
type: "object",
|
|
67
|
+
_type: "callout",
|
|
68
|
+
tone: "note",
|
|
69
|
+
content: [{
|
|
70
|
+
type: "paragraph",
|
|
71
|
+
children: [{
|
|
72
|
+
text: "Takes effect immediately."
|
|
73
|
+
}]
|
|
74
|
+
}]
|
|
75
|
+
}, {
|
|
76
|
+
type: "object",
|
|
77
|
+
_type: "button-reference",
|
|
78
|
+
label: "Save Changes",
|
|
79
|
+
variant: "primary"
|
|
80
|
+
}];
|
|
81
|
+
it("validates a sample message that mixes default blocks and catalog objects", function () {
|
|
82
|
+
expect((0, _types.isPortableTextContent)(sampleMessageContent)).toBe(true);
|
|
83
|
+
});
|
|
84
|
+
it("keeps unknown block and object types valid so older clients degrade instead of break", function () {
|
|
85
|
+
expect((0, _types.isPortableTextContent)([{
|
|
86
|
+
type: "some-future-block",
|
|
87
|
+
payload: 1
|
|
88
|
+
}, {
|
|
89
|
+
type: "object",
|
|
90
|
+
_type: "some-future-element",
|
|
91
|
+
data: true
|
|
92
|
+
}])).toBe(true);
|
|
93
|
+
});
|
|
94
|
+
it("rejects nodes without a type discriminator and objects without _type", function () {
|
|
95
|
+
expect((0, _types.isPortableTextContent)([{
|
|
96
|
+
children: []
|
|
97
|
+
}])).toBe(false);
|
|
98
|
+
expect((0, _types.isPortableTextContent)([{
|
|
99
|
+
type: "object"
|
|
100
|
+
}])).toBe(false);
|
|
101
|
+
expect((0, _types.isPortableTextContent)(["paragraph"])).toBe(false);
|
|
102
|
+
expect((0, _types.isPortableTextContent)({
|
|
103
|
+
content: []
|
|
104
|
+
})).toBe(false);
|
|
105
|
+
});
|
|
106
|
+
it("rejects known blocks whose shape a serializer bug has broken", function () {
|
|
107
|
+
expect((0, _types.isPortableTextContent)([{
|
|
108
|
+
type: "paragraph"
|
|
109
|
+
}])).toBe(false);
|
|
110
|
+
expect((0, _types.isPortableTextContent)([{
|
|
111
|
+
type: "heading",
|
|
112
|
+
level: 2,
|
|
113
|
+
children: "oops"
|
|
114
|
+
}])).toBe(false);
|
|
115
|
+
expect((0, _types.isPortableTextContent)([{
|
|
116
|
+
type: "paragraph",
|
|
117
|
+
children: [{
|
|
118
|
+
marks: ["strong"]
|
|
119
|
+
}]
|
|
120
|
+
}])).toBe(false);
|
|
121
|
+
expect((0, _types.isPortableTextContent)([{
|
|
122
|
+
type: "list"
|
|
123
|
+
}])).toBe(false);
|
|
124
|
+
expect((0, _types.isPortableTextContent)([{
|
|
125
|
+
type: "list",
|
|
126
|
+
children: ["not a node"]
|
|
127
|
+
}])).toBe(false);
|
|
128
|
+
expect((0, _types.isPortableTextContent)([{
|
|
129
|
+
type: "media"
|
|
130
|
+
}])).toBe(false);
|
|
131
|
+
expect((0, _types.isPortableTextContent)([{
|
|
132
|
+
type: "titled-text",
|
|
133
|
+
content: []
|
|
134
|
+
}])).toBe(false);
|
|
135
|
+
expect((0, _types.isPortableTextContent)([{
|
|
136
|
+
type: "titled-text",
|
|
137
|
+
title: "Ranges",
|
|
138
|
+
content: "oops"
|
|
139
|
+
}])).toBe(false);
|
|
140
|
+
});
|
|
141
|
+
it("tells blocks, objects and spans apart", function () {
|
|
142
|
+
var heading = sampleMessageContent[0],
|
|
143
|
+
paragraph = sampleMessageContent[1];
|
|
144
|
+
var callout = sampleMessageContent[5];
|
|
145
|
+
expect((0, _types.isPortableTextBlock)(heading)).toBe(true);
|
|
146
|
+
expect((0, _types.isPortableTextBlock)(callout)).toBe(false);
|
|
147
|
+
expect((0, _types.isPortableTextObjectNode)(callout)).toBe(true);
|
|
148
|
+
expect((0, _types.isPortableTextObjectNode)(heading)).toBe(false);
|
|
149
|
+
expect((0, _types.isPortableTextSpan)({
|
|
150
|
+
text: "plain"
|
|
151
|
+
})).toBe(true);
|
|
152
|
+
expect((0, _types.isPortableTextSpan)(paragraph)).toBe(false);
|
|
153
|
+
});
|
|
154
|
+
it("ships a universal default set free of product elements", function () {
|
|
155
|
+
expect(_types.PORTABLE_TEXT_DEFAULT_BLOCKS).toEqual(["paragraph", "heading", "list", "list-item", "media", "titled-text"]);
|
|
156
|
+
expect(_types.PORTABLE_TEXT_DEFAULT_MARKS).toEqual(["strong", "em", "code", "link"]);
|
|
157
|
+
});
|
|
158
|
+
it("accepts an application components map through the injection contract", function () {
|
|
159
|
+
var _components$onUnknown, _components$marks;
|
|
160
|
+
var seen = [];
|
|
161
|
+
var components = {
|
|
162
|
+
marks: {
|
|
163
|
+
"interface-name": function interfaceName(_ref) {
|
|
164
|
+
var children = _ref.children;
|
|
165
|
+
return /*#__PURE__*/(0, _react.createElement)(_react.Fragment, null, children);
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
objects: {
|
|
169
|
+
callout: function callout(_ref2) {
|
|
170
|
+
var children = _ref2.children;
|
|
171
|
+
return /*#__PURE__*/(0, _react.createElement)(_react.Fragment, null, children);
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
onUnknownType: function onUnknownType(kind, type) {
|
|
175
|
+
seen.push("".concat(kind, ":").concat(type));
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
(_components$onUnknown = components.onUnknownType) === null || _components$onUnknown === void 0 || _components$onUnknown.call(components, "object", "some-future-element");
|
|
179
|
+
expect(Object.keys((_components$marks = components.marks) !== null && _components$marks !== void 0 ? _components$marks : {})).toEqual(["interface-name"]);
|
|
180
|
+
expect(seen).toEqual(["object:some-future-element"]);
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
//# sourceMappingURL=types.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.test.js","names":["_react","require","_types","describe","sampleMessageContent","type","level","children","text","marks","article","style","src","variant","caption","title","content","_type","tone","label","it","expect","isPortableTextContent","toBe","payload","data","heading","paragraph","callout","isPortableTextBlock","isPortableTextObjectNode","isPortableTextSpan","PORTABLE_TEXT_DEFAULT_BLOCKS","toEqual","PORTABLE_TEXT_DEFAULT_MARKS","_components$onUnknown","_components$marks","seen","components","interfaceName","_ref","createElement","Fragment","objects","_ref2","onUnknownType","kind","push","concat","call","Object","keys"],"sources":["../../../../src/components/PortableText/types.test.ts"],"sourcesContent":["import { createElement, Fragment } from \"react\";\n\nimport {\n isPortableTextBlock,\n isPortableTextContent,\n isPortableTextObjectNode,\n isPortableTextSpan,\n PORTABLE_TEXT_DEFAULT_BLOCKS,\n PORTABLE_TEXT_DEFAULT_MARKS,\n PortableTextComponents,\n PortableTextContent,\n} from \"./types\";\n\ndescribe(\"PortableText envelope\", () => {\n const sampleMessageContent: PortableTextContent = [\n { type: \"heading\", level: 2, children: [{ text: \"IP Firewall\" }] },\n {\n type: \"paragraph\",\n children: [\n { text: \"Open the \" },\n { text: \"Security page\", marks: [\"interface-name\"] },\n { text: \" and press \" },\n { text: \"Enter\", marks: [\"keyboard-key\"] },\n { text: \". Read more in \" },\n {\n text: \"the help article\",\n marks: [{ type: \"doc-link\", article: \"ip-firewall\" }],\n },\n { text: \".\" },\n ],\n },\n {\n type: \"list\",\n style: \"bullet\",\n children: [\n {\n type: \"list-item\",\n children: [{ text: \"Allowlist the IPs you trust\" }],\n },\n {\n type: \"list-item\",\n children: [{ text: \"immediately\", marks: [\"strong\"] }],\n },\n ],\n },\n {\n type: \"media\",\n src: \"/screenshots/firewall.png\",\n variant: \"screenshot\",\n caption: \"The firewall settings\",\n },\n {\n type: \"titled-text\",\n title: \"Allowlist the IPs you trust\",\n level: 3,\n content: [\n { type: \"paragraph\", children: [{ text: \"Add one range per line.\" }] },\n ],\n },\n {\n type: \"object\",\n _type: \"callout\",\n tone: \"note\",\n content: [\n {\n type: \"paragraph\",\n children: [{ text: \"Takes effect immediately.\" }],\n },\n ],\n },\n {\n type: \"object\",\n _type: \"button-reference\",\n label: \"Save Changes\",\n variant: \"primary\",\n },\n ];\n\n it(\"validates a sample message that mixes default blocks and catalog objects\", () => {\n expect(isPortableTextContent(sampleMessageContent)).toBe(true);\n });\n\n it(\"keeps unknown block and object types valid so older clients degrade instead of break\", () => {\n expect(\n isPortableTextContent([\n { type: \"some-future-block\", payload: 1 },\n { type: \"object\", _type: \"some-future-element\", data: true },\n ])\n ).toBe(true);\n });\n\n it(\"rejects nodes without a type discriminator and objects without _type\", () => {\n expect(isPortableTextContent([{ children: [] }])).toBe(false);\n expect(isPortableTextContent([{ type: \"object\" }])).toBe(false);\n expect(isPortableTextContent([\"paragraph\"])).toBe(false);\n expect(isPortableTextContent({ content: [] })).toBe(false);\n });\n\n it(\"rejects known blocks whose shape a serializer bug has broken\", () => {\n expect(isPortableTextContent([{ type: \"paragraph\" }])).toBe(false);\n expect(\n isPortableTextContent([{ type: \"heading\", level: 2, children: \"oops\" }])\n ).toBe(false);\n expect(\n isPortableTextContent([\n { type: \"paragraph\", children: [{ marks: [\"strong\"] }] },\n ])\n ).toBe(false);\n expect(isPortableTextContent([{ type: \"list\" }])).toBe(false);\n expect(\n isPortableTextContent([{ type: \"list\", children: [\"not a node\"] }])\n ).toBe(false);\n expect(isPortableTextContent([{ type: \"media\" }])).toBe(false);\n expect(isPortableTextContent([{ type: \"titled-text\", content: [] }])).toBe(\n false\n );\n expect(\n isPortableTextContent([\n { type: \"titled-text\", title: \"Ranges\", content: \"oops\" },\n ])\n ).toBe(false);\n });\n\n it(\"tells blocks, objects and spans apart\", () => {\n const [heading, paragraph] = sampleMessageContent;\n const callout = sampleMessageContent[5];\n\n expect(isPortableTextBlock(heading)).toBe(true);\n expect(isPortableTextBlock(callout)).toBe(false);\n expect(isPortableTextObjectNode(callout)).toBe(true);\n expect(isPortableTextObjectNode(heading)).toBe(false);\n expect(isPortableTextSpan({ text: \"plain\" })).toBe(true);\n expect(isPortableTextSpan(paragraph)).toBe(false);\n });\n\n it(\"ships a universal default set free of product elements\", () => {\n expect(PORTABLE_TEXT_DEFAULT_BLOCKS).toEqual([\n \"paragraph\",\n \"heading\",\n \"list\",\n \"list-item\",\n \"media\",\n \"titled-text\",\n ]);\n expect(PORTABLE_TEXT_DEFAULT_MARKS).toEqual([\n \"strong\",\n \"em\",\n \"code\",\n \"link\",\n ]);\n });\n\n it(\"accepts an application components map through the injection contract\", () => {\n const seen: string[] = [];\n const components: PortableTextComponents = {\n marks: {\n \"interface-name\": ({ children }) =>\n createElement(Fragment, null, children),\n },\n objects: {\n callout: ({ children }) => createElement(Fragment, null, children),\n },\n onUnknownType: (kind, type) => {\n seen.push(`${kind}:${type}`);\n },\n };\n\n components.onUnknownType?.(\"object\", \"some-future-element\");\n\n expect(Object.keys(components.marks ?? {})).toEqual([\"interface-name\"]);\n expect(seen).toEqual([\"object:some-future-element\"]);\n });\n});\n"],"mappings":";;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAWAE,QAAQ,CAAC,uBAAuB,EAAE,YAAM;EACtC,IAAMC,oBAAyC,GAAG,CAChD;IAAEC,IAAI,EAAE,SAAS;IAAEC,KAAK,EAAE,CAAC;IAAEC,QAAQ,EAAE,CAAC;MAAEC,IAAI,EAAE;IAAc,CAAC;EAAE,CAAC,EAClE;IACEH,IAAI,EAAE,WAAW;IACjBE,QAAQ,EAAE,CACR;MAAEC,IAAI,EAAE;IAAY,CAAC,EACrB;MAAEA,IAAI,EAAE,eAAe;MAAEC,KAAK,EAAE,CAAC,gBAAgB;IAAE,CAAC,EACpD;MAAED,IAAI,EAAE;IAAc,CAAC,EACvB;MAAEA,IAAI,EAAE,O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AAQ,CAAC;QAAA;MAC3C,CAAC;MACDoC,OAAO,EAAE;QACPf,OAAO,EAAE,SAATA,OAAOA,CAAAgB,KAAA;UAAA,IAAKrC,QAAQ,GAAAqC,KAAA,CAARrC,QAAQ;UAAA,oBAAO,IAAAkC,oBAAa,EAACC,eAAQ,EAAE,IAAI,EAAEnC,QAAQ,CAAC;QAAA;MACpE,CAAC;MACDsC,aAAa,EAAE,SAAfA,aAAaA,CAAGC,IAAI,EAAEzC,IAAI,EAAK;QAC7BgC,IAAI,CAACU,IAAI,IAAAC,MAAA,CAAIF,IAAI,OAAAE,MAAA,CAAI3C,IAAI,CAAE,CAAC;MAC9B;IACF,CAAC;IAED,CAAA8B,qBAAA,GAAAG,UAAU,CAACO,aAAa,cAAAV,qBAAA,eAAxBA,qBAAA,CAAAc,IAAA,CAAAX,UAAU,EAAiB,QAAQ,EAAE,qBAAqB,CAAC;IAE3DjB,MAAM,CAAC6B,MAAM,CAACC,IAAI,EAAAf,iBAAA,GAACE,UAAU,CAAC7B,KAAK,cAAA2B,iBAAA,cAAAA,iBAAA,GAAI,CAAC,CAAC,CAAC,CAAC,CAACH,OAAO,CAAC,CAAC,gBAAgB,CAAC,CAAC;IACvEZ,MAAM,CAACgB,IAAI,CAAC,CAACJ,OAAO,CAAC,CAAC,4BAA4B,CAAC,CAAC;EACtD,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Row = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _Styles = require("./Styles");
|
|
9
|
+
var _excluded = ["space", "align", "collapseBelow", "children"];
|
|
10
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
11
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
12
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
13
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
14
|
+
var Row = exports.Row = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
15
|
+
var _ref$space = _ref.space,
|
|
16
|
+
space = _ref$space === void 0 ? "md" : _ref$space,
|
|
17
|
+
_ref$align = _ref.align,
|
|
18
|
+
align = _ref$align === void 0 ? "center" : _ref$align,
|
|
19
|
+
collapseBelow = _ref.collapseBelow,
|
|
20
|
+
children = _ref.children,
|
|
21
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement(_Styles.StyledRow, _extends({
|
|
23
|
+
ref: ref,
|
|
24
|
+
$space: space,
|
|
25
|
+
$align: align,
|
|
26
|
+
$collapse: collapseBelow
|
|
27
|
+
}, rest), children);
|
|
28
|
+
});
|
|
29
|
+
Row.displayName = "Row";
|
|
30
|
+
//# sourceMappingURL=Row.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Row.js","names":["_react","_interopRequireWildcard","require","_Styles","_excluded","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","_objectWithoutProperties","_objectWithoutPropertiesLoose","getOwnPropertySymbols","indexOf","propertyIsEnumerable","Row","exports","forwardRef","_ref","ref","_ref$space","space","_ref$align","align","collapseBelow","children","rest","createElement","StyledRow","$space","$align","$collapse","displayName"],"sources":["../../../../src/components/Row/Row.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport { StyledRow } from \"./Styles\";\nimport { Breakpoint } from \"../BreakPoints\";\nimport { Align, Space } from \"../LayoutTokens\";\n\nexport interface IRowProps extends React.ComponentPropsWithoutRef<\"div\"> {\n space?: Space;\n align?: Align;\n collapseBelow?: Breakpoint;\n}\n\nexport const Row = forwardRef<HTMLDivElement, IRowProps>(\n (\n { space = \"md\", align = \"center\", collapseBelow, children, ...rest },\n ref\n ) => (\n <StyledRow\n ref={ref}\n $space={space}\n $align={align}\n $collapse={collapseBelow}\n {...rest}\n >\n {children}\n </StyledRow>\n )\n);\n\nRow.displayName = \"Row\";\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAAqC,IAAAE,SAAA;AAAA,SAAAH,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,wBAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM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AAM;IACdS,MAAM,EAAEP,KAAM;IACdQ,SAAS,EAAEP;EAAc,GACrBE,IAAI,GAEPD,QACQ,CAAC;AAAA,CAEhB,CAAC;AAEDV,GAAG,CAACiB,WAAW,GAAG,KAAK","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StyledRow = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
|
+
var _BreakPoints = require("../BreakPoints");
|
|
9
|
+
var _LayoutTokens = require("../LayoutTokens");
|
|
10
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
11
|
+
var StyledRow = exports.StyledRow = _styledComponents.default.div.withConfig({
|
|
12
|
+
displayName: "Styles__StyledRow",
|
|
13
|
+
componentId: "sc-1sfgw5v-0"
|
|
14
|
+
})(["display:flex;flex-direction:row;flex-wrap:wrap;align-items:", ";gap:", ";", ""], function (_ref) {
|
|
15
|
+
var $align = _ref.$align;
|
|
16
|
+
return _LayoutTokens.FLEX_ALIGN[$align];
|
|
17
|
+
}, function (_ref2) {
|
|
18
|
+
var $space = _ref2.$space;
|
|
19
|
+
return _LayoutTokens.SPACE[$space];
|
|
20
|
+
}, function (_ref3) {
|
|
21
|
+
var $collapse = _ref3.$collapse;
|
|
22
|
+
return $collapse && (0, _styledComponents.css)(["", "{flex-direction:column;align-items:stretch;}"], _BreakPoints.screenBelow[$collapse]);
|
|
23
|
+
});
|
|
24
|
+
StyledRow.displayName = "StyledRow";
|
|
25
|
+
//# sourceMappingURL=Styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Styles.js","names":["_styledComponents","_interopRequireWildcard","require","_BreakPoints","_LayoutTokens","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledRow","exports","styled","div","withConfig","displayName","componentId","_ref","$align","FLEX_ALIGN","_ref2","$space","SPACE","_ref3","$collapse","css","screenBelow"],"sources":["../../../../src/components/Row/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { Breakpoint, screenBelow } from \"../BreakPoints\";\nimport { Align, FLEX_ALIGN, Space, SPACE } from \"../LayoutTokens\";\n\nexport const StyledRow = styled.div<{\n $space: Space;\n $align: Align;\n $collapse?: Breakpoint;\n}>`\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n align-items: ${({ $align }) => FLEX_ALIGN[$align]};\n gap: ${({ $space }) => SPACE[$space]};\n\n ${({ $collapse }) =>\n $collapse &&\n css`\n ${screenBelow[$collapse]} {\n flex-direction: column;\n align-items: stretch;\n }\n `}\n`;\n\nStyledRow.displayName = \"StyledRow\";\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAAkE,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,wBAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MA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AAW,GAAG,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _Row = require("./Row");
|
|
7
|
+
Object.keys(_Row).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _Row[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _Row[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_Row","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["../../../../src/components/Row/index.ts"],"sourcesContent":["export * from \"./Row\";\n"],"mappings":";;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,IAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,IAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,IAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Stack = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _Styles = require("./Styles");
|
|
9
|
+
var _excluded = ["space", "align", "children"];
|
|
10
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
11
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
12
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
13
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
14
|
+
var Stack = exports.Stack = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
15
|
+
var _ref$space = _ref.space,
|
|
16
|
+
space = _ref$space === void 0 ? "md" : _ref$space,
|
|
17
|
+
align = _ref.align,
|
|
18
|
+
children = _ref.children,
|
|
19
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
+
return /*#__PURE__*/_react.default.createElement(_Styles.StyledStack, _extends({
|
|
21
|
+
ref: ref,
|
|
22
|
+
$space: space,
|
|
23
|
+
$align: align
|
|
24
|
+
}, rest), children);
|
|
25
|
+
});
|
|
26
|
+
Stack.displayName = "Stack";
|
|
27
|
+
//# sourceMappingURL=Stack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stack.js","names":["_react","_interopRequireWildcard","require","_Styles","_excluded","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","_objectWithoutProperties","_objectWithoutPropertiesLoose","getOwnPropertySymbols","indexOf","propertyIsEnumerable","Stack","exports","forwardRef","_ref","ref","_ref$space","space","align","children","rest","createElement","StyledStack","$space","$align","displayName"],"sources":["../../../../src/components/Stack/Stack.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport { StyledStack } from \"./Styles\";\nimport { Align, Space } from \"../LayoutTokens\";\n\nexport interface IStackProps extends React.ComponentPropsWithoutRef<\"div\"> {\n space?: Space;\n align?: Align;\n}\n\nexport const Stack = forwardRef<HTMLDivElement, IStackProps>(\n ({ space = \"md\", align, children, ...rest }, ref) => (\n <StyledStack ref={ref} $space={space} $align={align} {...rest}>\n {children}\n </StyledStack>\n )\n);\n\nStack.displayName = \"Stack\";\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAAuC,IAAAE,SAAA;AAAA,SAAAH,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,wBAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,C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