@multiplatform.one/markdown 10.1.0 → 10.1.2
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/Video/index.cjs +1 -1
- package/dist/cjs/Video/index.native.cjs +1 -1
- package/dist/cjs/Video/index.native.js +1 -1
- package/dist/cjs/Video/index.native.js.map +1 -1
- package/dist/cjs/mermaid/MermaidBlock.cjs +1 -1
- package/dist/esm/Video/index.mjs +1 -1
- package/dist/esm/Video/index.mjs.map +1 -1
- package/dist/esm/Video/index.native.js +1 -1
- package/dist/esm/Video/index.native.js.map +1 -1
- package/dist/esm/mermaid/MermaidBlock.mjs +1 -1
- package/dist/esm/mermaid/MermaidBlock.mjs.map +1 -1
- package/dist/jsx/Video/index.mjs +1 -1
- package/dist/jsx/Video/index.mjs.map +1 -1
- package/dist/jsx/Video/index.native.cjs +1 -1
- package/dist/jsx/Video/index.native.js +1 -1
- package/dist/jsx/Video/index.native.js.map +1 -1
- package/dist/jsx/mermaid/MermaidBlock.mjs +1 -1
- package/dist/jsx/mermaid/MermaidBlock.mjs.map +1 -1
- package/package.json +9 -9
- package/src/Video/index.tsx +1 -1
- package/src/mermaid/MermaidBlock.tsx +1 -1
package/dist/cjs/Video/index.cjs
CHANGED
|
@@ -35,7 +35,7 @@ function Video({ src, children, muted = true, autoPlay = true, controls = false,
|
|
|
35
35
|
marginHorizontal: 0,
|
|
36
36
|
marginVertical: "6",
|
|
37
37
|
gap: "2",
|
|
38
|
-
paddingTop:
|
|
38
|
+
paddingTop: children && !hasMedia ? "2" : void 0,
|
|
39
39
|
...props,
|
|
40
40
|
children: [import_tamagui.isWeb ? src ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {
|
|
41
41
|
render: "video",
|
|
@@ -38,7 +38,7 @@ function Video(param) {
|
|
|
38
38
|
marginHorizontal: 0,
|
|
39
39
|
marginVertical: "6",
|
|
40
40
|
gap: "2",
|
|
41
|
-
paddingTop:
|
|
41
|
+
paddingTop: children && !hasMedia ? "2" : void 0,
|
|
42
42
|
...props,
|
|
43
43
|
children: [import_tamagui.isWeb ? src ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {
|
|
44
44
|
render: "video",
|
|
@@ -38,7 +38,7 @@ function Video(param) {
|
|
|
38
38
|
marginHorizontal: 0,
|
|
39
39
|
marginVertical: "6",
|
|
40
40
|
gap: "2",
|
|
41
|
-
paddingTop:
|
|
41
|
+
paddingTop: children && !hasMedia ? "2" : void 0,
|
|
42
42
|
...props,
|
|
43
43
|
children: [import_tamagui.isWeb ? src ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {
|
|
44
44
|
render: "video",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":[],"sources":["cjs/Video/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Video_exports = {};\n__export(Video_exports, {\n Video: () => Video\n});\nmodule.exports = __toCommonJS(Video_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_tamagui = require(\"tamagui\");\nvar import_theme = require(\"@multiplatform.one/theme\");\nvar import_tokenPx = require(\"../shared/tokenPx\");\nfunction Video(param) {\n var { src, children, muted = true, autoPlay = true, controls = false, loop = true, poster, ...props } = param;\n var { knobProps } = (0, import_theme.useResolvedKnobs)();\n var radiusPx = (0, import_tokenPx.tokenPx)(knobProps.borderRadius.borderRadius, 8, \"radius\");\n var fallbackMin = (0, import_tokenPx.tokenPx)(knobProps.sizeToken, 24) * 8;\n var hasMedia = !import_tamagui.isWeb || Boolean(src);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {\n render: \"figure\",\n marginHorizontal: 0,\n marginVertical: \"6\",\n gap: \"2\",\n paddingTop:
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["cjs/Video/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Video_exports = {};\n__export(Video_exports, {\n Video: () => Video\n});\nmodule.exports = __toCommonJS(Video_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_tamagui = require(\"tamagui\");\nvar import_theme = require(\"@multiplatform.one/theme\");\nvar import_tokenPx = require(\"../shared/tokenPx\");\nfunction Video(param) {\n var { src, children, muted = true, autoPlay = true, controls = false, loop = true, poster, ...props } = param;\n var { knobProps } = (0, import_theme.useResolvedKnobs)();\n var radiusPx = (0, import_tokenPx.tokenPx)(knobProps.borderRadius.borderRadius, 8, \"radius\");\n var fallbackMin = (0, import_tokenPx.tokenPx)(knobProps.sizeToken, 24) * 8;\n var hasMedia = !import_tamagui.isWeb || Boolean(src);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {\n render: \"figure\",\n marginHorizontal: 0,\n marginVertical: \"6\",\n gap: \"2\",\n paddingTop: children && !hasMedia ? \"2\" : void 0,\n ...props,\n children: [\n import_tamagui.isWeb ? src ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {\n render: \"video\",\n // @ts-expect-error HTML video attributes via render prop\n src,\n autoPlay,\n playsInline: true,\n muted,\n controls,\n loop,\n poster,\n // R11: media radius stays UNCLAMPED and rides the radius knob.\n style: {\n width: \"100%\",\n display: \"block\",\n borderRadius: radiusPx\n }\n }) : (\n // omit the element entirely for an empty src (SB-M-1227)\n null\n ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {\n ...knobProps.panelPadding,\n ...knobProps.borderRadius,\n backgroundColor: \"color-3\",\n alignItems: \"center\",\n justifyContent: \"center\",\n minHeight: fallbackMin,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Paragraph, {\n color: \"color-9\",\n size: knobProps.sizeToken,\n ...knobProps.body,\n children: \"Video playback requires a native video player\"\n })\n }),\n children ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Paragraph, {\n render: \"figcaption\",\n color: knobProps.textAccentColor,\n size: knobProps.sizeToken,\n ...knobProps.body,\n children\n }) : null\n ]\n });\n}\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IA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AE,eAAe,QAAQ;GAC9F,QAAQ;GAER;GACA;GACA,aAAa;GACb;GACA;GACA;GACA;GAEA,OAAO;IACL,OAAO;IACP,SAAS;IACT,cAAc;GAChB;EACF,CAAC,IAEC,OACkB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,eAAe,QAAQ;GACrE,GAAG,UAAU;GACb,GAAG,UAAU;GACb,iBAAiB;GACjB,YAAY;GACZ,gBAAgB;GAChB,WAAW;GACX,UAA0B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,eAAe,WAAW;IAC9E,OAAO;IACP,MAAM,UAAU;IAChB,GAAG,UAAU;IACb,UAAU;GACZ,CAAC;EACH,CAAC,GACD,WAA2B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,eAAe,WAAW;GAC/E,QAAQ;GACR,OAAO,UAAU;GACjB,MAAM,UAAU;GAChB,GAAG,UAAU;GACb;EACF,CAAC,IAAI,IACP;CACF,CAAC;AACH"}
|
|
@@ -89,7 +89,7 @@ function MermaidBlock({ children }) {
|
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.View, {
|
|
92
|
-
paddingTop:
|
|
92
|
+
paddingTop: state.status === "error" ? "2" : void 0,
|
|
93
93
|
children: [state.status === "error" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components2.Text, {
|
|
94
94
|
color: "$red-11",
|
|
95
95
|
fontSize: 13,
|
package/dist/esm/Video/index.mjs
CHANGED
|
@@ -13,7 +13,7 @@ function Video({ src, children, muted = true, autoPlay = true, controls = false,
|
|
|
13
13
|
marginHorizontal: 0,
|
|
14
14
|
marginVertical: "6",
|
|
15
15
|
gap: "2",
|
|
16
|
-
paddingTop:
|
|
16
|
+
paddingTop: children && !hasMedia ? "2" : void 0,
|
|
17
17
|
...props,
|
|
18
18
|
children: [isWeb ? src ? /* @__PURE__ */ jsx(YStack, {
|
|
19
19
|
render: "video",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["esm/Video/index.js"],"sourcesContent":["import { isWeb, Paragraph, YStack } from \"tamagui\";\nimport { useResolvedKnobs } from \"@multiplatform.one/theme\";\nimport { tokenPx } from \"../shared/tokenPx\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nfunction Video({\n src,\n children,\n muted = true,\n autoPlay = true,\n controls = false,\n loop = true,\n poster,\n ...props\n}) {\n const { knobProps } = useResolvedKnobs();\n const radiusPx = tokenPx(knobProps.borderRadius.borderRadius, 8, \"radius\");\n const fallbackMin = tokenPx(knobProps.sizeToken, 24) * 8;\n const hasMedia = !isWeb || Boolean(src);\n return /* @__PURE__ */ jsxs(\n YStack,\n {\n render: \"figure\",\n marginHorizontal: 0,\n marginVertical: \"6\",\n gap: \"2\",\n paddingTop:
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["esm/Video/index.js"],"sourcesContent":["import { isWeb, Paragraph, YStack } from \"tamagui\";\nimport { useResolvedKnobs } from \"@multiplatform.one/theme\";\nimport { tokenPx } from \"../shared/tokenPx\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nfunction Video({\n src,\n children,\n muted = true,\n autoPlay = true,\n controls = false,\n loop = true,\n poster,\n ...props\n}) {\n const { knobProps } = useResolvedKnobs();\n const radiusPx = tokenPx(knobProps.borderRadius.borderRadius, 8, \"radius\");\n const fallbackMin = tokenPx(knobProps.sizeToken, 24) * 8;\n const hasMedia = !isWeb || Boolean(src);\n return /* @__PURE__ */ jsxs(\n YStack,\n {\n render: \"figure\",\n marginHorizontal: 0,\n marginVertical: \"6\",\n gap: \"2\",\n paddingTop: children && !hasMedia ? \"2\" : void 0,\n ...props,\n children: [\n isWeb ? src ? /* @__PURE__ */ jsx(\n YStack,\n {\n render: \"video\",\n src,\n autoPlay,\n playsInline: true,\n muted,\n controls,\n loop,\n poster,\n style: { width: \"100%\", display: \"block\", borderRadius: radiusPx }\n }\n ) : (\n // omit the element entirely for an empty src (SB-M-1227)\n null\n ) : /* @__PURE__ */ jsx(\n YStack,\n {\n ...knobProps.panelPadding,\n ...knobProps.borderRadius,\n backgroundColor: \"color-3\",\n alignItems: \"center\",\n justifyContent: \"center\",\n minHeight: fallbackMin,\n children: /* @__PURE__ */ jsx(Paragraph, { color: \"color-9\", size: knobProps.sizeToken, ...knobProps.body, children: \"Video playback requires a native video player\" })\n }\n ),\n children ? /* @__PURE__ */ jsx(\n Paragraph,\n {\n render: \"figcaption\",\n color: knobProps.textAccentColor,\n size: knobProps.sizeToken,\n ...knobProps.body,\n children\n }\n ) : null\n ]\n }\n );\n}\nexport {\n Video\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;;;AAIA,SAAS,MAAM,EACb,KACA,UACA,QAAQ,MACR,WAAW,MACX,WAAW,OACX,OAAO,MACP,QACA,GAAG,SACF;CACD,MAAM,EAAE,cAAc,iBAAiB;CACvC,MAAM,WAAW,QAAQ,UAAU,aAAa,cAAc,GAAG,QAAQ;CACzE,MAAM,cAAc,QAAQ,UAAU,WAAW,EAAE,IAAI;CACvD,MAAM,WAAW,CAAC,SAAS,QAAQ,GAAG;CACtC,OAAuB,qBACrB,QACA;EACE,QAAQ;EACR,kBAAkB;EAClB,gBAAgB;EAChB,KAAK;EACL,YAAY,YAAY,CAAC,WAAW,MAAM,KAAK;EAC/C,GAAG;EACH,UAAU,CACR,QAAQ,MAAsB,oBAC5B,QACA;GACE,QAAQ;GACR;GACA;GACA,aAAa;GACb;GACA;GACA;GACA;GACA,OAAO;IAAE,OAAO;IAAQ,SAAS;IAAS,cAAc;GAAS;EACnE,CACF,IAEE,OACkB,oBAClB,QACA;GACE,GAAG,UAAU;GACb,GAAG,UAAU;GACb,iBAAiB;GACjB,YAAY;GACZ,gBAAgB;GAChB,WAAW;GACX,UAA0B,oBAAI,WAAW;IAAE,OAAO;IAAW,MAAM,UAAU;IAAW,GAAG,UAAU;IAAM,UAAU;GAAgD,CAAC;EACxK,CACF,GACA,WAA2B,oBACzB,WACA;GACE,QAAQ;GACR,OAAO,UAAU;GACjB,MAAM,UAAU;GAChB,GAAG,UAAU;GACb;EACF,CACF,IAAI,IACN;CACF,CACF;AACF"}
|
|
@@ -14,7 +14,7 @@ function Video(param) {
|
|
|
14
14
|
marginHorizontal: 0,
|
|
15
15
|
marginVertical: "6",
|
|
16
16
|
gap: "2",
|
|
17
|
-
paddingTop:
|
|
17
|
+
paddingTop: children && !hasMedia ? "2" : void 0,
|
|
18
18
|
...props,
|
|
19
19
|
children: [isWeb ? src ? /* @__PURE__ */ jsx(YStack, {
|
|
20
20
|
render: "video",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":[],"sources":["esm/Video/index.native.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { isWeb, Paragraph, YStack } from \"tamagui\";\nimport { useResolvedKnobs } from \"@multiplatform.one/theme\";\nimport { tokenPx } from \"../shared/tokenPx\";\nfunction Video(param) {\n var { src, children, muted = true, autoPlay = true, controls = false, loop = true, poster, ...props } = param;\n var { knobProps } = useResolvedKnobs();\n var radiusPx = tokenPx(knobProps.borderRadius.borderRadius, 8, \"radius\");\n var fallbackMin = tokenPx(knobProps.sizeToken, 24) * 8;\n var hasMedia = !isWeb || Boolean(src);\n return /* @__PURE__ */ _jsxs(YStack, {\n render: \"figure\",\n marginHorizontal: 0,\n marginVertical: \"6\",\n gap: \"2\",\n paddingTop:
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["esm/Video/index.native.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { isWeb, Paragraph, YStack } from \"tamagui\";\nimport { useResolvedKnobs } from \"@multiplatform.one/theme\";\nimport { tokenPx } from \"../shared/tokenPx\";\nfunction Video(param) {\n var { src, children, muted = true, autoPlay = true, controls = false, loop = true, poster, ...props } = param;\n var { knobProps } = useResolvedKnobs();\n var radiusPx = tokenPx(knobProps.borderRadius.borderRadius, 8, \"radius\");\n var fallbackMin = tokenPx(knobProps.sizeToken, 24) * 8;\n var hasMedia = !isWeb || Boolean(src);\n return /* @__PURE__ */ _jsxs(YStack, {\n render: \"figure\",\n marginHorizontal: 0,\n marginVertical: \"6\",\n gap: \"2\",\n paddingTop: children && !hasMedia ? \"2\" : void 0,\n ...props,\n children: [\n isWeb ? src ? /* @__PURE__ */ _jsx(YStack, {\n render: \"video\",\n // @ts-expect-error HTML video attributes via render prop\n src,\n autoPlay,\n playsInline: true,\n muted,\n controls,\n loop,\n poster,\n // R11: media radius stays UNCLAMPED and rides the radius knob.\n style: {\n width: \"100%\",\n display: \"block\",\n borderRadius: radiusPx\n }\n }) : (\n // omit the element entirely for an empty src (SB-M-1227)\n null\n ) : /* @__PURE__ */ _jsx(YStack, {\n ...knobProps.panelPadding,\n ...knobProps.borderRadius,\n backgroundColor: \"color-3\",\n alignItems: \"center\",\n justifyContent: \"center\",\n minHeight: fallbackMin,\n children: /* @__PURE__ */ _jsx(Paragraph, {\n color: \"color-9\",\n size: knobProps.sizeToken,\n ...knobProps.body,\n children: \"Video playback requires a native video player\"\n })\n }),\n children ? /* @__PURE__ */ _jsx(Paragraph, {\n render: \"figcaption\",\n color: knobProps.textAccentColor,\n size: knobProps.sizeToken,\n ...knobProps.body,\n children\n }) : null\n ]\n });\n}\nexport {\n Video\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;;;AAIA,SAAS,MAAM,OAAO;CACpB,IAAI,EAAE,KAAK,UAAU,QAAQ,MAAM,WAAW,MAAM,WAAW,OAAO,OAAO,MAAM,QAAQ,GAAG,UAAU;CACxG,IAAI,EAAE,cAAc,iBAAiB;CACrC,IAAI,WAAW,QAAQ,UAAU,aAAa,cAAc,GAAG,QAAQ;CACvE,IAAI,cAAc,QAAQ,UAAU,WAAW,EAAE,IAAI;CACrD,IAAI,WAAW,CAAC,SAAS,QAAQ,GAAG;CACpC,OAAuB,qBAAM,QAAQ;EACnC,QAAQ;EACR,kBAAkB;EAClB,gBAAgB;EAChB,KAAK;EACL,YAAY,YAAY,CAAC,WAAW,MAAM,KAAK;EAC/C,GAAG;EACH,UAAU,CACR,QAAQ,MAAsB,oBAAK,QAAQ;GACzC,QAAQ;GAER;GACA;GACA,aAAa;GACb;GACA;GACA;GACA;GAEA,OAAO;IACL,OAAO;IACP,SAAS;IACT,cAAc;GAChB;EACF,CAAC,IAEC,OACkB,oBAAK,QAAQ;GAC/B,GAAG,UAAU;GACb,GAAG,UAAU;GACb,iBAAiB;GACjB,YAAY;GACZ,gBAAgB;GAChB,WAAW;GACX,UAA0B,oBAAK,WAAW;IACxC,OAAO;IACP,MAAM,UAAU;IAChB,GAAG,UAAU;IACb,UAAU;GACZ,CAAC;EACH,CAAC,GACD,WAA2B,oBAAK,WAAW;GACzC,QAAQ;GACR,OAAO,UAAU;GACjB,MAAM,UAAU;GAChB,GAAG,UAAU;GACb;EACF,CAAC,IAAI,IACP;CACF,CAAC;AACH"}
|
|
@@ -67,7 +67,7 @@ function MermaidBlock({ children }) {
|
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
69
|
return /* @__PURE__ */ jsxs(View, {
|
|
70
|
-
paddingTop:
|
|
70
|
+
paddingTop: state.status === "error" ? "2" : void 0,
|
|
71
71
|
children: [state.status === "error" ? /* @__PURE__ */ jsx(Text, {
|
|
72
72
|
color: "$red-11",
|
|
73
73
|
fontSize: 13,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MermaidBlock.js","names":[],"sources":["esm/mermaid/MermaidBlock.js"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\nimport { View, useThemeName } from \"tamagui\";\nimport { edgeColorAt, resolveFontTokenFamily, useResolvedKnobs } from \"@multiplatform.one/theme\";\nimport { markdownCodeColors } from \"../shared/colorRamps\";\nimport { CodeBlock } from \"../components\";\nimport { mountDiagramSvg } from \"./mountDiagramSvg\";\nimport { renderMermaidDiagram } from \"./renderMermaidDiagram\";\nimport { Text } from \"@multiplatform.one/components\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nfunction MermaidBlock({ children }) {\n const { knobProps } = useResolvedKnobs();\n const themeName = useThemeName();\n const scheme = String(themeName).startsWith(\"dark\") ? \"dark\" : \"light\";\n const fontFamily = resolveFontTokenFamily(knobProps.body.fontFamily);\n const [state, setState] = useState({ status: \"loading\" });\n const svgHostRef = useRef(null);\n useEffect(() => {\n let cancelled = false;\n setState({ status: \"loading\" });\n renderMermaidDiagram(children, { scheme, fontFamily }).then((result) => {\n if (cancelled) return;\n setState(\n result.ok ? { status: \"ok\", svg: result.svg } : { status: \"error\", error: result.error }\n );\n });\n return () => {\n cancelled = true;\n };\n }, [children, scheme, fontFamily]);\n useEffect(() => {\n if (state.status !== \"ok\" || !svgHostRef.current) return;\n mountDiagramSvg(svgHostRef.current, state.svg);\n }, [state]);\n if (state.status === \"ok\") {\n return /* @__PURE__ */ jsx(\n View,\n {\n ...knobProps.borderRadiusNested ?? { borderRadius: \"$4\" },\n backgroundColor: markdownCodeColors.background.base,\n borderWidth: knobProps.borderRadius.borderWidth,\n borderColor: edgeColorAt(markdownCodeColors.border.base, knobProps.borderWidthStop),\n paddingHorizontal: 16,\n paddingVertical: 12,\n marginVertical: \"2\",\n overflow: \"hidden\",\n children: /* @__PURE__ */ jsx(\n \"div\",\n {\n ref: svgHostRef,\n role: \"img\",\n \"aria-label\": \"Mermaid diagram\",\n \"data-mermaid-diagram\": \"true\",\n style: { display: \"flex\", justifyContent: \"center\", overflowX: \"auto\" }\n }\n )\n }\n );\n }\n return /* @__PURE__ */ jsxs(View, { paddingTop:
|
|
1
|
+
{"version":3,"file":"MermaidBlock.js","names":[],"sources":["esm/mermaid/MermaidBlock.js"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\nimport { View, useThemeName } from \"tamagui\";\nimport { edgeColorAt, resolveFontTokenFamily, useResolvedKnobs } from \"@multiplatform.one/theme\";\nimport { markdownCodeColors } from \"../shared/colorRamps\";\nimport { CodeBlock } from \"../components\";\nimport { mountDiagramSvg } from \"./mountDiagramSvg\";\nimport { renderMermaidDiagram } from \"./renderMermaidDiagram\";\nimport { Text } from \"@multiplatform.one/components\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nfunction MermaidBlock({ children }) {\n const { knobProps } = useResolvedKnobs();\n const themeName = useThemeName();\n const scheme = String(themeName).startsWith(\"dark\") ? \"dark\" : \"light\";\n const fontFamily = resolveFontTokenFamily(knobProps.body.fontFamily);\n const [state, setState] = useState({ status: \"loading\" });\n const svgHostRef = useRef(null);\n useEffect(() => {\n let cancelled = false;\n setState({ status: \"loading\" });\n renderMermaidDiagram(children, { scheme, fontFamily }).then((result) => {\n if (cancelled) return;\n setState(\n result.ok ? { status: \"ok\", svg: result.svg } : { status: \"error\", error: result.error }\n );\n });\n return () => {\n cancelled = true;\n };\n }, [children, scheme, fontFamily]);\n useEffect(() => {\n if (state.status !== \"ok\" || !svgHostRef.current) return;\n mountDiagramSvg(svgHostRef.current, state.svg);\n }, [state]);\n if (state.status === \"ok\") {\n return /* @__PURE__ */ jsx(\n View,\n {\n ...knobProps.borderRadiusNested ?? { borderRadius: \"$4\" },\n backgroundColor: markdownCodeColors.background.base,\n borderWidth: knobProps.borderRadius.borderWidth,\n borderColor: edgeColorAt(markdownCodeColors.border.base, knobProps.borderWidthStop),\n paddingHorizontal: 16,\n paddingVertical: 12,\n marginVertical: \"2\",\n overflow: \"hidden\",\n children: /* @__PURE__ */ jsx(\n \"div\",\n {\n ref: svgHostRef,\n role: \"img\",\n \"aria-label\": \"Mermaid diagram\",\n \"data-mermaid-diagram\": \"true\",\n style: { display: \"flex\", justifyContent: \"center\", overflowX: \"auto\" }\n }\n )\n }\n );\n }\n return /* @__PURE__ */ jsxs(View, { paddingTop: state.status === \"error\" ? \"2\" : void 0, children: [\n state.status === \"error\" ? /* @__PURE__ */ jsx(Text, { color: \"$red-11\", fontSize: 13, role: \"alert\", children: `Mermaid: ${state.error}` }) : null,\n /* @__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AE,SAAS;KAAQ,gBAAgB;KAAU,WAAW;IAAO;GACxE,CACF;EACF,CACF;CACF;CACA,OAAuB,qBAAK,MAAM;EAAE,YAAY,MAAM,WAAW,UAAU,MAAM,KAAK;EAAG,UAAU,CACjG,MAAM,WAAW,UAA0B,oBAAI,MAAM;GAAE,OAAO;GAAW,UAAU;GAAI,MAAM;GAAS,UAAU,YAAY,MAAM;EAAQ,CAAC,IAAI,MAC/H,oBAAI,WAAW;GAAE,MAAM;GAAW;EAAS,CAAC,CAC9D;CAAE,CAAC;AACL"}
|
package/dist/jsx/Video/index.mjs
CHANGED
|
@@ -13,7 +13,7 @@ function Video({ src, children, muted = true, autoPlay = true, controls = false,
|
|
|
13
13
|
marginHorizontal: 0,
|
|
14
14
|
marginVertical: "6",
|
|
15
15
|
gap: "2",
|
|
16
|
-
paddingTop:
|
|
16
|
+
paddingTop: children && !hasMedia ? "2" : void 0,
|
|
17
17
|
...props,
|
|
18
18
|
children: [isWeb ? src ? /* @__PURE__ */ jsx(YStack, {
|
|
19
19
|
render: "video",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["jsx/Video/index.js"],"sourcesContent":["import { isWeb, Paragraph, YStack } from \"tamagui\";\nimport { useResolvedKnobs } from \"@multiplatform.one/theme\";\nimport { tokenPx } from \"../shared/tokenPx\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nfunction Video({\n src,\n children,\n muted = true,\n autoPlay = true,\n controls = false,\n loop = true,\n poster,\n ...props\n}) {\n const { knobProps } = useResolvedKnobs();\n const radiusPx = tokenPx(knobProps.borderRadius.borderRadius, 8, \"radius\");\n const fallbackMin = tokenPx(knobProps.sizeToken, 24) * 8;\n const hasMedia = !isWeb || Boolean(src);\n return /* @__PURE__ */ jsxs(\n YStack,\n {\n render: \"figure\",\n marginHorizontal: 0,\n marginVertical: \"6\",\n gap: \"2\",\n paddingTop:
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["jsx/Video/index.js"],"sourcesContent":["import { isWeb, Paragraph, YStack } from \"tamagui\";\nimport { useResolvedKnobs } from \"@multiplatform.one/theme\";\nimport { tokenPx } from \"../shared/tokenPx\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nfunction Video({\n src,\n children,\n muted = true,\n autoPlay = true,\n controls = false,\n loop = true,\n poster,\n ...props\n}) {\n const { knobProps } = useResolvedKnobs();\n const radiusPx = tokenPx(knobProps.borderRadius.borderRadius, 8, \"radius\");\n const fallbackMin = tokenPx(knobProps.sizeToken, 24) * 8;\n const hasMedia = !isWeb || Boolean(src);\n return /* @__PURE__ */ jsxs(\n YStack,\n {\n render: \"figure\",\n marginHorizontal: 0,\n marginVertical: \"6\",\n gap: \"2\",\n paddingTop: children && !hasMedia ? \"2\" : void 0,\n ...props,\n children: [\n isWeb ? src ? /* @__PURE__ */ jsx(\n YStack,\n {\n render: \"video\",\n src,\n autoPlay,\n playsInline: true,\n muted,\n controls,\n loop,\n poster,\n style: { width: \"100%\", display: \"block\", borderRadius: radiusPx }\n }\n ) : (\n // omit the element entirely for an empty src (SB-M-1227)\n null\n ) : /* @__PURE__ */ jsx(\n YStack,\n {\n ...knobProps.panelPadding,\n ...knobProps.borderRadius,\n backgroundColor: \"color-3\",\n alignItems: \"center\",\n justifyContent: \"center\",\n minHeight: fallbackMin,\n children: /* @__PURE__ */ jsx(Paragraph, { color: \"color-9\", size: knobProps.sizeToken, ...knobProps.body, children: \"Video playback requires a native video player\" })\n }\n ),\n children ? /* @__PURE__ */ jsx(\n Paragraph,\n {\n render: \"figcaption\",\n color: knobProps.textAccentColor,\n size: knobProps.sizeToken,\n ...knobProps.body,\n children\n }\n ) : null\n ]\n }\n );\n}\nexport {\n Video\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;;;AAIA,SAAS,MAAM,EACb,KACA,UACA,QAAQ,MACR,WAAW,MACX,WAAW,OACX,OAAO,MACP,QACA,GAAG,SACF;CACD,MAAM,EAAE,cAAc,iBAAiB;CACvC,MAAM,WAAW,QAAQ,UAAU,aAAa,cAAc,GAAG,QAAQ;CACzE,MAAM,cAAc,QAAQ,UAAU,WAAW,EAAE,IAAI;CACvD,MAAM,WAAW,CAAC,SAAS,QAAQ,GAAG;CACtC,OAAuB,qBACrB,QACA;EACE,QAAQ;EACR,kBAAkB;EAClB,gBAAgB;EAChB,KAAK;EACL,YAAY,YAAY,CAAC,WAAW,MAAM,KAAK;EAC/C,GAAG;EACH,UAAU,CACR,QAAQ,MAAsB,oBAC5B,QACA;GACE,QAAQ;GACR;GACA;GACA,aAAa;GACb;GACA;GACA;GACA;GACA,OAAO;IAAE,OAAO;IAAQ,SAAS;IAAS,cAAc;GAAS;EACnE,CACF,IAEE,OACkB,oBAClB,QACA;GACE,GAAG,UAAU;GACb,GAAG,UAAU;GACb,iBAAiB;GACjB,YAAY;GACZ,gBAAgB;GAChB,WAAW;GACX,UAA0B,oBAAI,WAAW;IAAE,OAAO;IAAW,MAAM,UAAU;IAAW,GAAG,UAAU;IAAM,UAAU;GAAgD,CAAC;EACxK,CACF,GACA,WAA2B,oBACzB,WACA;GACE,QAAQ;GACR,OAAO,UAAU;GACjB,MAAM,UAAU;GAChB,GAAG,UAAU;GACb;EACF,CACF,IAAI,IACN;CACF,CACF;AACF"}
|
|
@@ -38,7 +38,7 @@ function Video(param) {
|
|
|
38
38
|
marginHorizontal: 0,
|
|
39
39
|
marginVertical: "6",
|
|
40
40
|
gap: "2",
|
|
41
|
-
paddingTop:
|
|
41
|
+
paddingTop: children && !hasMedia ? "2" : void 0,
|
|
42
42
|
...props,
|
|
43
43
|
children: [import_tamagui.isWeb ? src ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {
|
|
44
44
|
render: "video",
|
|
@@ -38,7 +38,7 @@ function Video(param) {
|
|
|
38
38
|
marginHorizontal: 0,
|
|
39
39
|
marginVertical: "6",
|
|
40
40
|
gap: "2",
|
|
41
|
-
paddingTop:
|
|
41
|
+
paddingTop: children && !hasMedia ? "2" : void 0,
|
|
42
42
|
...props,
|
|
43
43
|
children: [import_tamagui.isWeb ? src ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {
|
|
44
44
|
render: "video",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":[],"sources":["jsx/Video/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Video_exports = {};\n__export(Video_exports, {\n Video: () => Video\n});\nmodule.exports = __toCommonJS(Video_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_tamagui = require(\"tamagui\");\nvar import_theme = require(\"@multiplatform.one/theme\");\nvar import_tokenPx = require(\"../shared/tokenPx\");\nfunction Video(param) {\n var { src, children, muted = true, autoPlay = true, controls = false, loop = true, poster, ...props } = param;\n var { knobProps } = (0, import_theme.useResolvedKnobs)();\n var radiusPx = (0, import_tokenPx.tokenPx)(knobProps.borderRadius.borderRadius, 8, \"radius\");\n var fallbackMin = (0, import_tokenPx.tokenPx)(knobProps.sizeToken, 24) * 8;\n var hasMedia = !import_tamagui.isWeb || Boolean(src);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {\n render: \"figure\",\n marginHorizontal: 0,\n marginVertical: \"6\",\n gap: \"2\",\n paddingTop:
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["jsx/Video/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Video_exports = {};\n__export(Video_exports, {\n Video: () => Video\n});\nmodule.exports = __toCommonJS(Video_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_tamagui = require(\"tamagui\");\nvar import_theme = require(\"@multiplatform.one/theme\");\nvar import_tokenPx = require(\"../shared/tokenPx\");\nfunction Video(param) {\n var { src, children, muted = true, autoPlay = true, controls = false, loop = true, poster, ...props } = param;\n var { knobProps } = (0, import_theme.useResolvedKnobs)();\n var radiusPx = (0, import_tokenPx.tokenPx)(knobProps.borderRadius.borderRadius, 8, \"radius\");\n var fallbackMin = (0, import_tokenPx.tokenPx)(knobProps.sizeToken, 24) * 8;\n var hasMedia = !import_tamagui.isWeb || Boolean(src);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {\n render: \"figure\",\n marginHorizontal: 0,\n marginVertical: \"6\",\n gap: \"2\",\n paddingTop: children && !hasMedia ? \"2\" : void 0,\n ...props,\n children: [\n import_tamagui.isWeb ? src ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {\n render: \"video\",\n // @ts-expect-error HTML video attributes via render prop\n src,\n autoPlay,\n playsInline: true,\n muted,\n controls,\n loop,\n poster,\n // R11: media radius stays UNCLAMPED and rides the radius knob.\n style: {\n width: \"100%\",\n display: \"block\",\n borderRadius: radiusPx\n }\n }) : (\n // omit the element entirely for an empty src (SB-M-1227)\n null\n ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {\n ...knobProps.panelPadding,\n ...knobProps.borderRadius,\n backgroundColor: \"color-3\",\n alignItems: \"center\",\n justifyContent: \"center\",\n minHeight: fallbackMin,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Paragraph, {\n color: \"color-9\",\n size: knobProps.sizeToken,\n ...knobProps.body,\n children: \"Video playback requires a native video player\"\n })\n }),\n children ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Paragraph, {\n render: \"figcaption\",\n color: knobProps.textAccentColor,\n size: knobProps.sizeToken,\n ...knobProps.body,\n children\n }) : null\n ]\n });\n}\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,g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CAAE,eAAe,WAAW;IAC9E,OAAO;IACP,MAAM,UAAU;IAChB,GAAG,UAAU;IACb,UAAU;GACZ,CAAC;EACH,CAAC,GACD,WAA2B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,eAAe,WAAW;GAC/E,QAAQ;GACR,OAAO,UAAU;GACjB,MAAM,UAAU;GAChB,GAAG,UAAU;GACb;EACF,CAAC,IAAI,IACP;CACF,CAAC;AACH"}
|
|
@@ -67,7 +67,7 @@ function MermaidBlock({ children }) {
|
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
69
|
return /* @__PURE__ */ jsxs(View, {
|
|
70
|
-
paddingTop:
|
|
70
|
+
paddingTop: state.status === "error" ? "2" : void 0,
|
|
71
71
|
children: [state.status === "error" ? /* @__PURE__ */ jsx(Text, {
|
|
72
72
|
color: "$red-11",
|
|
73
73
|
fontSize: 13,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MermaidBlock.js","names":[],"sources":["jsx/mermaid/MermaidBlock.js"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\nimport { View, useThemeName } from \"tamagui\";\nimport { edgeColorAt, resolveFontTokenFamily, useResolvedKnobs } from \"@multiplatform.one/theme\";\nimport { markdownCodeColors } from \"../shared/colorRamps\";\nimport { CodeBlock } from \"../components\";\nimport { mountDiagramSvg } from \"./mountDiagramSvg\";\nimport { renderMermaidDiagram } from \"./renderMermaidDiagram\";\nimport { Text } from \"@multiplatform.one/components\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nfunction MermaidBlock({ children }) {\n const { knobProps } = useResolvedKnobs();\n const themeName = useThemeName();\n const scheme = String(themeName).startsWith(\"dark\") ? \"dark\" : \"light\";\n const fontFamily = resolveFontTokenFamily(knobProps.body.fontFamily);\n const [state, setState] = useState({ status: \"loading\" });\n const svgHostRef = useRef(null);\n useEffect(() => {\n let cancelled = false;\n setState({ status: \"loading\" });\n renderMermaidDiagram(children, { scheme, fontFamily }).then((result) => {\n if (cancelled) return;\n setState(\n result.ok ? { status: \"ok\", svg: result.svg } : { status: \"error\", error: result.error }\n );\n });\n return () => {\n cancelled = true;\n };\n }, [children, scheme, fontFamily]);\n useEffect(() => {\n if (state.status !== \"ok\" || !svgHostRef.current) return;\n mountDiagramSvg(svgHostRef.current, state.svg);\n }, [state]);\n if (state.status === \"ok\") {\n return /* @__PURE__ */ jsx(\n View,\n {\n ...knobProps.borderRadiusNested ?? { borderRadius: \"$4\" },\n backgroundColor: markdownCodeColors.background.base,\n borderWidth: knobProps.borderRadius.borderWidth,\n borderColor: edgeColorAt(markdownCodeColors.border.base, knobProps.borderWidthStop),\n paddingHorizontal: 16,\n paddingVertical: 12,\n marginVertical: \"2\",\n overflow: \"hidden\",\n children: /* @__PURE__ */ jsx(\n \"div\",\n {\n ref: svgHostRef,\n role: \"img\",\n \"aria-label\": \"Mermaid diagram\",\n \"data-mermaid-diagram\": \"true\",\n style: { display: \"flex\", justifyContent: \"center\", overflowX: \"auto\" }\n }\n )\n }\n );\n }\n return /* @__PURE__ */ jsxs(View, { paddingTop:
|
|
1
|
+
{"version":3,"file":"MermaidBlock.js","names":[],"sources":["jsx/mermaid/MermaidBlock.js"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\nimport { View, useThemeName } from \"tamagui\";\nimport { edgeColorAt, resolveFontTokenFamily, useResolvedKnobs } from \"@multiplatform.one/theme\";\nimport { markdownCodeColors } from \"../shared/colorRamps\";\nimport { CodeBlock } from \"../components\";\nimport { mountDiagramSvg } from \"./mountDiagramSvg\";\nimport { renderMermaidDiagram } from \"./renderMermaidDiagram\";\nimport { Text } from \"@multiplatform.one/components\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nfunction MermaidBlock({ children }) {\n const { knobProps } = useResolvedKnobs();\n const themeName = useThemeName();\n const scheme = String(themeName).startsWith(\"dark\") ? \"dark\" : \"light\";\n const fontFamily = resolveFontTokenFamily(knobProps.body.fontFamily);\n const [state, setState] = useState({ status: \"loading\" });\n const svgHostRef = useRef(null);\n useEffect(() => {\n let cancelled = false;\n setState({ status: \"loading\" });\n renderMermaidDiagram(children, { scheme, fontFamily }).then((result) => {\n if (cancelled) return;\n setState(\n result.ok ? { status: \"ok\", svg: result.svg } : { status: \"error\", error: result.error }\n );\n });\n return () => {\n cancelled = true;\n };\n }, [children, scheme, fontFamily]);\n useEffect(() => {\n if (state.status !== \"ok\" || !svgHostRef.current) return;\n mountDiagramSvg(svgHostRef.current, state.svg);\n }, [state]);\n if (state.status === \"ok\") {\n return /* @__PURE__ */ jsx(\n View,\n {\n ...knobProps.borderRadiusNested ?? { borderRadius: \"$4\" },\n backgroundColor: markdownCodeColors.background.base,\n borderWidth: knobProps.borderRadius.borderWidth,\n borderColor: edgeColorAt(markdownCodeColors.border.base, knobProps.borderWidthStop),\n paddingHorizontal: 16,\n paddingVertical: 12,\n marginVertical: \"2\",\n overflow: \"hidden\",\n children: /* @__PURE__ */ jsx(\n \"div\",\n {\n ref: svgHostRef,\n role: \"img\",\n \"aria-label\": \"Mermaid diagram\",\n \"data-mermaid-diagram\": \"true\",\n style: { display: \"flex\", justifyContent: \"center\", overflowX: \"auto\" }\n }\n )\n }\n );\n }\n return /* @__PURE__ */ jsxs(View, { paddingTop: state.status === \"error\" ? \"2\" : void 0, children: [\n state.status === \"error\" ? /* @__PURE__ */ jsx(Text, { color: \"$red-11\", fontSize: 13, role: \"alert\", children: `Mermaid: ${state.error}` }) : null,\n /* @__PURE__ */ jsx(CodeBlock, { lang: \"mermaid\", children })\n ] });\n}\nexport {\n MermaidBlock\n};\n//# sourceMappingURL=MermaidBlock.js.map\n"],"mappings":";;;;;;;;;;;AASA,SAAS,aAAa,EAAE,YAAY;CAClC,MAAM,EAAE,cAAc,iBAAiB;CACvC,MAAM,YAAY,aAAa;CAC/B,MAAM,SAAS,OAAO,SAAS,CAAC,CAAC,WAAW,MAAM,IAAI,SAAS;CAC/D,MAAM,aAAa,uBAAuB,UAAU,KAAK,UAAU;CACnE,MAAM,CAAC,OA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}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@multiplatform.one/markdown",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.2",
|
|
4
4
|
"description": "Cross-platform markdown renderer with Shiki syntax highlighting for React and React Native",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cross-platform",
|
|
@@ -68,11 +68,11 @@
|
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@mdx-js/mdx": "^3.1.1",
|
|
70
70
|
"@mdx-js/react": "^3.1.1",
|
|
71
|
-
"@multiplatform.one/components": "^10.1.
|
|
72
|
-
"@multiplatform.one/platform": "^10.1.
|
|
73
|
-
"@multiplatform.one/router": "^10.1.
|
|
74
|
-
"@multiplatform.one/table-primitives": "^10.1.
|
|
75
|
-
"@multiplatform.one/theme": "^10.1.
|
|
71
|
+
"@multiplatform.one/components": "^10.1.2",
|
|
72
|
+
"@multiplatform.one/platform": "^10.1.2",
|
|
73
|
+
"@multiplatform.one/router": "^10.1.2",
|
|
74
|
+
"@multiplatform.one/table-primitives": "^10.1.2",
|
|
75
|
+
"@multiplatform.one/theme": "^10.1.2",
|
|
76
76
|
"@tamagui/linear-gradient": "3.2.3",
|
|
77
77
|
"@tamagui/react-native-svg": "3.2.3",
|
|
78
78
|
"@tamagui/web": "3.2.3",
|
|
@@ -90,9 +90,9 @@
|
|
|
90
90
|
"unist-util-visit": "^5.1.0"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
|
-
"@multiplatform.one/config": "10.1.
|
|
94
|
-
"@multiplatform.one/storybook": "10.1.
|
|
95
|
-
"@multiplatform.one/test-utils": "10.1.
|
|
93
|
+
"@multiplatform.one/config": "10.1.2",
|
|
94
|
+
"@multiplatform.one/storybook": "10.1.2",
|
|
95
|
+
"@multiplatform.one/test-utils": "10.1.2",
|
|
96
96
|
"@tamagui/build": "3.2.3",
|
|
97
97
|
"@testing-library/jest-dom": "^7.0.1",
|
|
98
98
|
"@testing-library/react": "^16.3.3",
|
package/src/Video/index.tsx
CHANGED
|
@@ -78,7 +78,7 @@ export function MermaidBlock({ children }: MermaidBlockProps) {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
return (
|
|
81
|
-
<View paddingTop={
|
|
81
|
+
<View paddingTop={state.status === "error" ? "2" : undefined}>
|
|
82
82
|
{state.status === "error" ? (
|
|
83
83
|
<Text color="$red-11" fontSize={13} role="alert">
|
|
84
84
|
{`Mermaid: ${state.error}`}
|