markdown-flow-ui 0.2.5 → 0.2.7-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/_virtual/index.cjs8.js +1 -1
  2. package/dist/_virtual/index.cjs9.js +1 -1
  3. package/dist/_virtual/index.es8.js +2 -2
  4. package/dist/_virtual/index.es9.js +2 -2
  5. package/dist/assets/markdown-flow-ui.css +1 -1
  6. package/dist/components/ContentRender/CodeBlock.cjs.js.map +1 -1
  7. package/dist/components/ContentRender/CodeBlock.d.ts +1 -1
  8. package/dist/components/ContentRender/CodeBlock.es.js.map +1 -1
  9. package/dist/components/ContentRender/ContentRender.cjs.js +2 -2
  10. package/dist/components/ContentRender/ContentRender.cjs.js.map +1 -1
  11. package/dist/components/ContentRender/ContentRender.es.js +212 -191
  12. package/dist/components/ContentRender/ContentRender.es.js.map +1 -1
  13. package/dist/components/ContentRender/plugins/CustomVariable.cjs.js +1 -1
  14. package/dist/components/ContentRender/plugins/CustomVariable.cjs.js.map +1 -1
  15. package/dist/components/ContentRender/plugins/CustomVariable.es.js +49 -43
  16. package/dist/components/ContentRender/plugins/CustomVariable.es.js.map +1 -1
  17. package/dist/components/MarkdownFlowEditor/locales/en-US.json.d.ts +70 -0
  18. package/dist/components/MarkdownFlowEditor/locales/fr-FR.json.d.ts +70 -0
  19. package/dist/components/MarkdownFlowEditor/locales/zh-CN.json.d.ts +70 -0
  20. package/dist/components/Slide/Slide.cjs.js +1 -1
  21. package/dist/components/Slide/Slide.cjs.js.map +1 -1
  22. package/dist/components/Slide/Slide.es.js +258 -254
  23. package/dist/components/Slide/Slide.es.js.map +1 -1
  24. package/dist/components/Slide/diff-utils.cjs.js +4 -4
  25. package/dist/components/Slide/diff-utils.cjs.js.map +1 -1
  26. package/dist/components/Slide/diff-utils.es.js +49 -49
  27. package/dist/components/Slide/diff-utils.es.js.map +1 -1
  28. package/dist/components/Slide/types.d.ts +1 -0
  29. package/dist/components/ui/inputGroup/input-group.cjs.js +1 -1
  30. package/dist/components/ui/inputGroup/input-group.cjs.js.map +1 -1
  31. package/dist/components/ui/inputGroup/input-group.d.ts +21 -1
  32. package/dist/components/ui/inputGroup/input-group.es.js +19 -17
  33. package/dist/components/ui/inputGroup/input-group.es.js.map +1 -1
  34. package/dist/components/ui/inputGroup/textarea.cjs.js.map +1 -1
  35. package/dist/components/ui/inputGroup/textarea.d.ts +2 -1
  36. package/dist/components/ui/inputGroup/textarea.es.js.map +1 -1
  37. package/dist/lib/mobileDevice.cjs.js +1 -1
  38. package/dist/lib/mobileDevice.cjs.js.map +1 -1
  39. package/dist/lib/mobileDevice.d.ts +1 -3
  40. package/dist/lib/mobileDevice.es.js +29 -38
  41. package/dist/lib/mobileDevice.es.js.map +1 -1
  42. package/dist/markdown-flow-ui-lib.css +1 -1
  43. package/dist/node_modules/@braintree/sanitize-url/dist/index.cjs.js +1 -1
  44. package/dist/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
  45. package/dist/node_modules/classnames/index.cjs.js +1 -1
  46. package/dist/node_modules/classnames/index.es.js +1 -1
  47. package/package.json +1 -1
  48. package/dist/components/ContentRender/ContentRender.stories.d.ts +0 -37
  49. package/dist/components/ContentRender/MarkdownFlowInput.stories.d.ts +0 -33
  50. package/dist/components/MarkdownFlow/MarkdownFlow.stories.d.ts +0 -31
  51. package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.stories.d.ts +0 -64
  52. package/dist/components/Slide/Slide.stories.d.ts +0 -2590
@@ -1,49 +1,40 @@
1
- const d = /Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini|Mobile/i, u = /iPad|Tablet/i, l = (e) => {
2
- const n = window.navigator?.userAgent ?? "";
1
+ const o = /Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini|Mobile/i, s = /iPad|Tablet/i, c = (e) => {
2
+ const t = window.navigator?.userAgent ?? "";
3
3
  return {
4
- hasMobileUserAgent: d.test(n),
5
- hasTabletLikeUserAgent: u.test(n)
4
+ hasMobileUserAgent: o.test(t),
5
+ hasTabletLikeUserAgent: s.test(t)
6
6
  };
7
- }, v = ({
7
+ }, a = ({
8
8
  hasMobileUserAgent: e,
9
- hasTabletLikeUserAgent: t
10
- }) => e || t, p = (e) => e?.includes("landscape") ? !0 : e?.includes("portrait") ? !1 : null, w = ({
9
+ hasTabletLikeUserAgent: n
10
+ }) => e || n, d = (e) => e?.includes("landscape") ? !0 : e?.includes("portrait") ? !1 : null, l = ({
11
11
  matchMediaLandscape: e,
12
- orientationType: t,
13
- innerWidth: n,
14
- innerHeight: r,
15
- visualViewportWidth: i,
16
- visualViewportHeight: o
12
+ orientationType: n,
13
+ innerWidth: t,
14
+ innerHeight: i
17
15
  }) => {
18
- if (typeof e == "boolean")
19
- return e;
20
- const s = p(t);
21
- if (s !== null)
22
- return s;
23
- const c = typeof i == "number" && i > 0 ? i : n, a = typeof o == "number" && o > 0 ? o : r;
24
- return typeof c != "number" || typeof a != "number" ? !1 : c > a;
25
- }, b = (e) => v(l()), E = (e) => {
26
- const t = window, n = typeof t.matchMedia == "function" ? t.matchMedia("(orientation: landscape)").matches : void 0;
27
- return w({
28
- matchMediaLandscape: n,
29
- orientationType: t.screen?.orientation?.type,
30
- innerWidth: t.innerWidth,
31
- innerHeight: t.innerHeight,
32
- visualViewportWidth: t.visualViewport?.width,
33
- visualViewportHeight: t.visualViewport?.height
16
+ const r = d(n);
17
+ return r !== null ? r : typeof e == "boolean" ? e : typeof t != "number" || typeof i != "number" ? !1 : t > i;
18
+ }, u = (e) => a(c()), p = (e) => {
19
+ const n = window, t = typeof n.matchMedia == "function" ? n.matchMedia("(orientation: landscape)").matches : void 0;
20
+ return l({
21
+ matchMediaLandscape: t,
22
+ orientationType: n.screen?.orientation?.type,
23
+ innerWidth: n.innerWidth,
24
+ innerHeight: n.innerHeight
34
25
  });
35
- }, L = (e, t) => {
36
- const n = window, r = n.screen?.orientation, i = n.visualViewport;
37
- return n.addEventListener("orientationchange", e), n.addEventListener("resize", e), r?.addEventListener?.("change", e), i?.addEventListener("resize", e), () => {
38
- n.removeEventListener("orientationchange", e), n.removeEventListener("resize", e), r?.removeEventListener?.("change", e), i?.removeEventListener("resize", e);
26
+ }, b = (e, n) => {
27
+ const t = window, i = t.screen?.orientation;
28
+ return t.addEventListener("orientationchange", e), i?.addEventListener?.("change", e), () => {
29
+ t.removeEventListener("orientationchange", e), i?.removeEventListener?.("change", e);
39
30
  };
40
31
  };
41
32
  export {
42
- l as getMobileDeviceCapabilities,
43
- E as isLandscapeViewport,
44
- b as isMobileDevice,
45
- v as resolveMobileDevice,
46
- w as resolveMobileViewportLandscape,
47
- L as subscribeMobileDeviceChange
33
+ c as getMobileDeviceCapabilities,
34
+ p as isLandscapeViewport,
35
+ u as isMobileDevice,
36
+ a as resolveMobileDevice,
37
+ l as resolveMobileViewportLandscape,
38
+ b as subscribeMobileDeviceChange
48
39
  };
49
40
  //# sourceMappingURL=mobileDevice.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mobileDevice.es.js","sources":["../../src/lib/mobileDevice.ts"],"sourcesContent":["export type MobileDeviceCapabilities = {\n hasMobileUserAgent: boolean;\n hasTabletLikeUserAgent: boolean;\n};\n\nexport type MobileViewportOrientation = {\n matchMediaLandscape?: boolean;\n orientationType?: string;\n innerWidth?: number;\n innerHeight?: number;\n visualViewportWidth?: number;\n visualViewportHeight?: number;\n};\n\nconst MOBILE_USER_AGENT_PATTERN =\n /Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini|Mobile/i;\nconst TABLET_USER_AGENT_PATTERN = /iPad|Tablet/i;\n\nexport const getMobileDeviceCapabilities = (\n win?: Window\n): MobileDeviceCapabilities => {\n const currentWindow = win ?? window;\n const userAgent = currentWindow.navigator?.userAgent ?? \"\";\n\n return {\n hasMobileUserAgent: MOBILE_USER_AGENT_PATTERN.test(userAgent),\n hasTabletLikeUserAgent: TABLET_USER_AGENT_PATTERN.test(userAgent),\n };\n};\n\nexport const resolveMobileDevice = ({\n hasMobileUserAgent,\n hasTabletLikeUserAgent,\n}: MobileDeviceCapabilities): boolean => {\n return hasMobileUserAgent || hasTabletLikeUserAgent;\n};\n\nconst resolveLandscapeFromOrientationType = (\n orientationType?: string\n): boolean | null => {\n if (orientationType?.includes(\"landscape\")) {\n return true;\n }\n\n if (orientationType?.includes(\"portrait\")) {\n return false;\n }\n\n return null;\n};\n\nexport const resolveMobileViewportLandscape = ({\n matchMediaLandscape,\n orientationType,\n innerWidth,\n innerHeight,\n visualViewportWidth,\n visualViewportHeight,\n}: MobileViewportOrientation): boolean => {\n if (typeof matchMediaLandscape === \"boolean\") {\n return matchMediaLandscape;\n }\n\n const orientationLandscape =\n resolveLandscapeFromOrientationType(orientationType);\n\n if (orientationLandscape !== null) {\n return orientationLandscape;\n }\n\n const viewportWidth =\n typeof visualViewportWidth === \"number\" && visualViewportWidth > 0\n ? visualViewportWidth\n : innerWidth;\n const viewportHeight =\n typeof visualViewportHeight === \"number\" && visualViewportHeight > 0\n ? visualViewportHeight\n : innerHeight;\n\n if (typeof viewportWidth !== \"number\" || typeof viewportHeight !== \"number\") {\n return false;\n }\n\n return viewportWidth > viewportHeight;\n};\n\nexport const isMobileDevice = (win?: Window): boolean =>\n resolveMobileDevice(getMobileDeviceCapabilities(win));\n\nexport const isLandscapeViewport = (win?: Window): boolean => {\n const currentWindow = win ?? window;\n const matchMediaLandscape =\n typeof currentWindow.matchMedia === \"function\"\n ? currentWindow.matchMedia(\"(orientation: landscape)\").matches\n : undefined;\n\n return resolveMobileViewportLandscape({\n matchMediaLandscape,\n orientationType: currentWindow.screen?.orientation?.type,\n innerWidth: currentWindow.innerWidth,\n innerHeight: currentWindow.innerHeight,\n visualViewportWidth: currentWindow.visualViewport?.width,\n visualViewportHeight: currentWindow.visualViewport?.height,\n });\n};\n\nexport const subscribeMobileDeviceChange = (\n onChange: () => void,\n win?: Window\n) => {\n const currentWindow = win ?? window;\n const screenOrientation = currentWindow.screen?.orientation;\n const visualViewport = currentWindow.visualViewport;\n\n currentWindow.addEventListener(\"orientationchange\", onChange);\n currentWindow.addEventListener(\"resize\", onChange);\n screenOrientation?.addEventListener?.(\"change\", onChange);\n visualViewport?.addEventListener(\"resize\", onChange);\n\n return () => {\n currentWindow.removeEventListener(\"orientationchange\", onChange);\n currentWindow.removeEventListener(\"resize\", onChange);\n screenOrientation?.removeEventListener?.(\"change\", onChange);\n visualViewport?.removeEventListener(\"resize\", onChange);\n };\n};\n"],"names":["MOBILE_USER_AGENT_PATTERN","TABLET_USER_AGENT_PATTERN","getMobileDeviceCapabilities","win","userAgent","resolveMobileDevice","hasMobileUserAgent","hasTabletLikeUserAgent","resolveLandscapeFromOrientationType","orientationType","resolveMobileViewportLandscape","matchMediaLandscape","innerWidth","innerHeight","visualViewportWidth","visualViewportHeight","orientationLandscape","viewportWidth","viewportHeight","isMobileDevice","isLandscapeViewport","currentWindow","subscribeMobileDeviceChange","onChange","screenOrientation","visualViewport"],"mappings":"AAcA,MAAMA,IACJ,oEACIC,IAA4B,gBAErBC,IAA8B,CACzCC,MAC6B;AAE7B,QAAMC,IADuB,OACG,WAAW,aAAa;AAExD,SAAO;AAAA,IACL,oBAAoBJ,EAA0B,KAAKI,CAAS;AAAA,IAC5D,wBAAwBH,EAA0B,KAAKG,CAAS;AAAA,EAAA;AAEpE,GAEaC,IAAsB,CAAC;AAAA,EAClC,oBAAAC;AAAA,EACA,wBAAAC;AACF,MACSD,KAAsBC,GAGzBC,IAAsC,CAC1CC,MAEIA,GAAiB,SAAS,WAAW,IAChC,KAGLA,GAAiB,SAAS,UAAU,IAC/B,KAGF,MAGIC,IAAiC,CAAC;AAAA,EAC7C,qBAAAC;AAAA,EACA,iBAAAF;AAAA,EACA,YAAAG;AAAA,EACA,aAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,sBAAAC;AACF,MAA0C;AACxC,MAAI,OAAOJ,KAAwB;AACjC,WAAOA;AAGT,QAAMK,IACJR,EAAoCC,CAAe;AAErD,MAAIO,MAAyB;AAC3B,WAAOA;AAGT,QAAMC,IACJ,OAAOH,KAAwB,YAAYA,IAAsB,IAC7DA,IACAF,GACAM,IACJ,OAAOH,KAAyB,YAAYA,IAAuB,IAC/DA,IACAF;AAEN,SAAI,OAAOI,KAAkB,YAAY,OAAOC,KAAmB,WAC1D,KAGFD,IAAgBC;AACzB,GAEaC,IAAiB,CAAChB,MAC7BE,EAAoBH,EAA+B,CAAC,GAEzCkB,IAAsB,CAACjB,MAA0B;AAC5D,QAAMkB,IAAuB,QACvBV,IACJ,OAAOU,EAAc,cAAe,aAChCA,EAAc,WAAW,0BAA0B,EAAE,UACrD;AAEN,SAAOX,EAA+B;AAAA,IACpC,qBAAAC;AAAA,IACA,iBAAiBU,EAAc,QAAQ,aAAa;AAAA,IACpD,YAAYA,EAAc;AAAA,IAC1B,aAAaA,EAAc;AAAA,IAC3B,qBAAqBA,EAAc,gBAAgB;AAAA,IACnD,sBAAsBA,EAAc,gBAAgB;AAAA,EAAA,CACrD;AACH,GAEaC,IAA8B,CACzCC,GACApB,MACG;AACH,QAAMkB,IAAuB,QACvBG,IAAoBH,EAAc,QAAQ,aAC1CI,IAAiBJ,EAAc;AAErC,SAAAA,EAAc,iBAAiB,qBAAqBE,CAAQ,GAC5DF,EAAc,iBAAiB,UAAUE,CAAQ,GACjDC,GAAmB,mBAAmB,UAAUD,CAAQ,GACxDE,GAAgB,iBAAiB,UAAUF,CAAQ,GAE5C,MAAM;AACX,IAAAF,EAAc,oBAAoB,qBAAqBE,CAAQ,GAC/DF,EAAc,oBAAoB,UAAUE,CAAQ,GACpDC,GAAmB,sBAAsB,UAAUD,CAAQ,GAC3DE,GAAgB,oBAAoB,UAAUF,CAAQ;AAAA,EACxD;AACF;"}
1
+ {"version":3,"file":"mobileDevice.es.js","sources":["../../src/lib/mobileDevice.ts"],"sourcesContent":["export type MobileDeviceCapabilities = {\n hasMobileUserAgent: boolean;\n hasTabletLikeUserAgent: boolean;\n};\n\nexport type MobileViewportOrientation = {\n matchMediaLandscape?: boolean;\n orientationType?: string;\n innerWidth?: number;\n innerHeight?: number;\n};\n\nconst MOBILE_USER_AGENT_PATTERN =\n /Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini|Mobile/i;\nconst TABLET_USER_AGENT_PATTERN = /iPad|Tablet/i;\n\nexport const getMobileDeviceCapabilities = (\n win?: Window\n): MobileDeviceCapabilities => {\n const currentWindow = win ?? window;\n const userAgent = currentWindow.navigator?.userAgent ?? \"\";\n\n return {\n hasMobileUserAgent: MOBILE_USER_AGENT_PATTERN.test(userAgent),\n hasTabletLikeUserAgent: TABLET_USER_AGENT_PATTERN.test(userAgent),\n };\n};\n\nexport const resolveMobileDevice = ({\n hasMobileUserAgent,\n hasTabletLikeUserAgent,\n}: MobileDeviceCapabilities): boolean => {\n return hasMobileUserAgent || hasTabletLikeUserAgent;\n};\n\nconst resolveLandscapeFromOrientationType = (\n orientationType?: string\n): boolean | null => {\n if (orientationType?.includes(\"landscape\")) {\n return true;\n }\n\n if (orientationType?.includes(\"portrait\")) {\n return false;\n }\n\n return null;\n};\n\nexport const resolveMobileViewportLandscape = ({\n matchMediaLandscape,\n orientationType,\n innerWidth,\n innerHeight,\n}: MobileViewportOrientation): boolean => {\n const orientationLandscape =\n resolveLandscapeFromOrientationType(orientationType);\n\n if (orientationLandscape !== null) {\n return orientationLandscape;\n }\n\n if (typeof matchMediaLandscape === \"boolean\") {\n return matchMediaLandscape;\n }\n\n if (typeof innerWidth !== \"number\" || typeof innerHeight !== \"number\") {\n return false;\n }\n\n return innerWidth > innerHeight;\n};\n\nexport const isMobileDevice = (win?: Window): boolean =>\n resolveMobileDevice(getMobileDeviceCapabilities(win));\n\nexport const isLandscapeViewport = (win?: Window): boolean => {\n const currentWindow = win ?? window;\n const matchMediaLandscape =\n typeof currentWindow.matchMedia === \"function\"\n ? currentWindow.matchMedia(\"(orientation: landscape)\").matches\n : undefined;\n\n return resolveMobileViewportLandscape({\n matchMediaLandscape,\n orientationType: currentWindow.screen?.orientation?.type,\n innerWidth: currentWindow.innerWidth,\n innerHeight: currentWindow.innerHeight,\n });\n};\n\nexport const subscribeMobileDeviceChange = (\n onChange: () => void,\n win?: Window\n) => {\n const currentWindow = win ?? window;\n const screenOrientation = currentWindow.screen?.orientation;\n\n currentWindow.addEventListener(\"orientationchange\", onChange);\n screenOrientation?.addEventListener?.(\"change\", onChange);\n\n return () => {\n currentWindow.removeEventListener(\"orientationchange\", onChange);\n screenOrientation?.removeEventListener?.(\"change\", onChange);\n };\n};\n"],"names":["MOBILE_USER_AGENT_PATTERN","TABLET_USER_AGENT_PATTERN","getMobileDeviceCapabilities","win","userAgent","resolveMobileDevice","hasMobileUserAgent","hasTabletLikeUserAgent","resolveLandscapeFromOrientationType","orientationType","resolveMobileViewportLandscape","matchMediaLandscape","innerWidth","innerHeight","orientationLandscape","isMobileDevice","isLandscapeViewport","currentWindow","subscribeMobileDeviceChange","onChange","screenOrientation"],"mappings":"AAYA,MAAMA,IACJ,oEACIC,IAA4B,gBAErBC,IAA8B,CACzCC,MAC6B;AAE7B,QAAMC,IADuB,OACG,WAAW,aAAa;AAExD,SAAO;AAAA,IACL,oBAAoBJ,EAA0B,KAAKI,CAAS;AAAA,IAC5D,wBAAwBH,EAA0B,KAAKG,CAAS;AAAA,EAAA;AAEpE,GAEaC,IAAsB,CAAC;AAAA,EAClC,oBAAAC;AAAA,EACA,wBAAAC;AACF,MACSD,KAAsBC,GAGzBC,IAAsC,CAC1CC,MAEIA,GAAiB,SAAS,WAAW,IAChC,KAGLA,GAAiB,SAAS,UAAU,IAC/B,KAGF,MAGIC,IAAiC,CAAC;AAAA,EAC7C,qBAAAC;AAAA,EACA,iBAAAF;AAAA,EACA,YAAAG;AAAA,EACA,aAAAC;AACF,MAA0C;AACxC,QAAMC,IACJN,EAAoCC,CAAe;AAErD,SAAIK,MAAyB,OACpBA,IAGL,OAAOH,KAAwB,YAC1BA,IAGL,OAAOC,KAAe,YAAY,OAAOC,KAAgB,WACpD,KAGFD,IAAaC;AACtB,GAEaE,IAAiB,CAACZ,MAC7BE,EAAoBH,EAA+B,CAAC,GAEzCc,IAAsB,CAACb,MAA0B;AAC5D,QAAMc,IAAuB,QACvBN,IACJ,OAAOM,EAAc,cAAe,aAChCA,EAAc,WAAW,0BAA0B,EAAE,UACrD;AAEN,SAAOP,EAA+B;AAAA,IACpC,qBAAAC;AAAA,IACA,iBAAiBM,EAAc,QAAQ,aAAa;AAAA,IACpD,YAAYA,EAAc;AAAA,IAC1B,aAAaA,EAAc;AAAA,EAAA,CAC5B;AACH,GAEaC,IAA8B,CACzCC,GACAhB,MACG;AACH,QAAMc,IAAuB,QACvBG,IAAoBH,EAAc,QAAQ;AAEhD,SAAAA,EAAc,iBAAiB,qBAAqBE,CAAQ,GAC5DC,GAAmB,mBAAmB,UAAUD,CAAQ,GAEjD,MAAM;AACX,IAAAF,EAAc,oBAAoB,qBAAqBE,CAAQ,GAC/DC,GAAmB,sBAAsB,UAAUD,CAAQ;AAAA,EAC7D;AACF;"}