markdown-flow-ui 0.2.35-dev.1 → 0.2.35-dev.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.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=r=>{const n=e=>Array.from(e.children).filter(t=>!["STYLE","SCRIPT","LINK"].includes(t.tagName));for(const e of n(r)){let t=e;for(;t;){const i=t.style;/^100(?:dvh|svh|lvh|vh)$/i.test(i?.minHeight.trim()??"")&&i.setProperty("min-height","0px",i.getPropertyPriority("min-height"));const o=n(t);t=o.length===1?o[0]:void 0}}};exports.normalizeContentViewportMinHeight=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=o=>{const r=t=>Array.from(t.childNodes).some(e=>e.nodeType===3&&!!e.textContent?.trim());if(r(o))return;const n=t=>Array.from(t.children).filter(e=>!["STYLE","SCRIPT","LINK"].includes(e.tagName));for(const t of n(o)){let e=t;for(;e;){const i=e.style;if(/^100(?:dvh|svh|lvh|vh)$/i.test(i?.minHeight.trim()??"")&&i.setProperty("min-height","0px",i.getPropertyPriority("min-height")),r(e))break;const l=n(e);e=l.length===1?l[0]:void 0}}};exports.normalizeContentViewportMinHeight=h;
2
2
  //# sourceMappingURL=content-viewport-min-height.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"content-viewport-min-height.cjs","sources":["../../../../src/components/ContentRender/utils/content-viewport-min-height.ts"],"sourcesContent":["/** Let full-viewport minimum-height shells fit the surrounding lesson flow. */\nexport const normalizeContentViewportMinHeight = (container: HTMLElement) => {\n const contentChildren = (element: Element) =>\n Array.from(element.children).filter(\n (child) => ![\"STYLE\", \"SCRIPT\", \"LINK\"].includes(child.tagName)\n );\n\n for (const root of contentChildren(container)) {\n let element: Element | undefined = root;\n while (element) {\n const style = (element as HTMLElement).style;\n // Normalize only a full-screen minimum, never an explicit height, pixel\n // minimum, padding, margin, or viewport-relative font size. The iframe\n // retains its stable layout viewport for vh/vmin-dependent content.\n if (/^100(?:dvh|svh|lvh|vh)$/i.test(style?.minHeight.trim() ?? \"\")) {\n style.setProperty(\n \"min-height\",\n \"0px\",\n style.getPropertyPriority(\"min-height\")\n );\n }\n const children = contentChildren(element);\n element = children.length === 1 ? children[0] : undefined;\n }\n }\n};\n"],"names":["normalizeContentViewportMinHeight","container","contentChildren","element","child","root","style","children"],"mappings":"gFACO,MAAMA,EAAqCC,GAA2B,CAC3E,MAAMC,EAAmBC,GACvB,MAAM,KAAKA,EAAQ,QAAQ,EAAE,OAC1BC,GAAU,CAAC,CAAC,QAAS,SAAU,MAAM,EAAE,SAASA,EAAM,OAAO,CAAA,EAGlE,UAAWC,KAAQH,EAAgBD,CAAS,EAAG,CAC7C,IAAIE,EAA+BE,EACnC,KAAOF,GAAS,CACd,MAAMG,EAASH,EAAwB,MAInC,2BAA2B,KAAKG,GAAO,UAAU,KAAA,GAAU,EAAE,GAC/DA,EAAM,YACJ,aACA,MACAA,EAAM,oBAAoB,YAAY,CAAA,EAG1C,MAAMC,EAAWL,EAAgBC,CAAO,EACxCA,EAAUI,EAAS,SAAW,EAAIA,EAAS,CAAC,EAAI,MAClD,CACF,CACF"}
1
+ {"version":3,"file":"content-viewport-min-height.cjs","sources":["../../../../src/components/ContentRender/utils/content-viewport-min-height.ts"],"sourcesContent":["/** Let full-viewport minimum-height shells fit the surrounding lesson flow. */\nexport const normalizeContentViewportMinHeight = (container: HTMLElement) => {\n const hasRenderedText = (element: Element) =>\n Array.from(element.childNodes).some(\n (node) => node.nodeType === 3 && Boolean(node.textContent?.trim())\n );\n if (hasRenderedText(container)) return;\n const contentChildren = (element: Element) =>\n Array.from(element.children).filter(\n (child) => ![\"STYLE\", \"SCRIPT\", \"LINK\"].includes(child.tagName)\n );\n\n for (const root of contentChildren(container)) {\n let element: Element | undefined = root;\n while (element) {\n const style = (element as HTMLElement).style;\n // Normalize only a full-screen minimum, never an explicit height, pixel\n // minimum, padding, margin, or viewport-relative font size. The iframe\n // retains its stable layout viewport for vh/vmin-dependent content.\n if (/^100(?:dvh|svh|lvh|vh)$/i.test(style?.minHeight.trim() ?? \"\")) {\n style.setProperty(\n \"min-height\",\n \"0px\",\n style.getPropertyPriority(\"min-height\")\n );\n }\n // Text plus an element is content, not a single-child wrapper.\n if (hasRenderedText(element)) break;\n const children = contentChildren(element);\n element = children.length === 1 ? children[0] : undefined;\n }\n }\n};\n"],"names":["normalizeContentViewportMinHeight","container","hasRenderedText","element","node","contentChildren","child","root","style","children"],"mappings":"gFACO,MAAMA,EAAqCC,GAA2B,CAC3E,MAAMC,EAAmBC,GACvB,MAAM,KAAKA,EAAQ,UAAU,EAAE,KAC5BC,GAASA,EAAK,WAAa,GAAK,EAAQA,EAAK,aAAa,KAAA,CAAM,EAErE,GAAIF,EAAgBD,CAAS,EAAG,OAChC,MAAMI,EAAmBF,GACvB,MAAM,KAAKA,EAAQ,QAAQ,EAAE,OAC1BG,GAAU,CAAC,CAAC,QAAS,SAAU,MAAM,EAAE,SAASA,EAAM,OAAO,CAAA,EAGlE,UAAWC,KAAQF,EAAgBJ,CAAS,EAAG,CAC7C,IAAIE,EAA+BI,EACnC,KAAOJ,GAAS,CACd,MAAMK,EAASL,EAAwB,MAYvC,GARI,2BAA2B,KAAKK,GAAO,UAAU,KAAA,GAAU,EAAE,GAC/DA,EAAM,YACJ,aACA,MACAA,EAAM,oBAAoB,YAAY,CAAA,EAItCN,EAAgBC,CAAO,EAAG,MAC9B,MAAMM,EAAWJ,EAAgBF,CAAO,EACxCA,EAAUM,EAAS,SAAW,EAAIA,EAAS,CAAC,EAAI,MAClD,CACF,CACF"}
@@ -1,22 +1,26 @@
1
- const h = (r) => {
2
- const n = (e) => Array.from(e.children).filter(
3
- (t) => !["STYLE", "SCRIPT", "LINK"].includes(t.tagName)
1
+ const l = (i) => {
2
+ const o = (t) => Array.from(t.childNodes).some(
3
+ (e) => e.nodeType === 3 && !!e.textContent?.trim()
4
4
  );
5
- for (const e of n(r)) {
6
- let t = e;
7
- for (; t; ) {
8
- const i = t.style;
9
- /^100(?:dvh|svh|lvh|vh)$/i.test(i?.minHeight.trim() ?? "") && i.setProperty(
5
+ if (o(i)) return;
6
+ const n = (t) => Array.from(t.children).filter(
7
+ (e) => !["STYLE", "SCRIPT", "LINK"].includes(e.tagName)
8
+ );
9
+ for (const t of n(i)) {
10
+ let e = t;
11
+ for (; e; ) {
12
+ const r = e.style;
13
+ if (/^100(?:dvh|svh|lvh|vh)$/i.test(r?.minHeight.trim() ?? "") && r.setProperty(
10
14
  "min-height",
11
15
  "0px",
12
- i.getPropertyPriority("min-height")
13
- );
14
- const o = n(t);
15
- t = o.length === 1 ? o[0] : void 0;
16
+ r.getPropertyPriority("min-height")
17
+ ), o(e)) break;
18
+ const h = n(e);
19
+ e = h.length === 1 ? h[0] : void 0;
16
20
  }
17
21
  }
18
22
  };
19
23
  export {
20
- h as normalizeContentViewportMinHeight
24
+ l as normalizeContentViewportMinHeight
21
25
  };
22
26
  //# sourceMappingURL=content-viewport-min-height.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"content-viewport-min-height.es.js","sources":["../../../../src/components/ContentRender/utils/content-viewport-min-height.ts"],"sourcesContent":["/** Let full-viewport minimum-height shells fit the surrounding lesson flow. */\nexport const normalizeContentViewportMinHeight = (container: HTMLElement) => {\n const contentChildren = (element: Element) =>\n Array.from(element.children).filter(\n (child) => ![\"STYLE\", \"SCRIPT\", \"LINK\"].includes(child.tagName)\n );\n\n for (const root of contentChildren(container)) {\n let element: Element | undefined = root;\n while (element) {\n const style = (element as HTMLElement).style;\n // Normalize only a full-screen minimum, never an explicit height, pixel\n // minimum, padding, margin, or viewport-relative font size. The iframe\n // retains its stable layout viewport for vh/vmin-dependent content.\n if (/^100(?:dvh|svh|lvh|vh)$/i.test(style?.minHeight.trim() ?? \"\")) {\n style.setProperty(\n \"min-height\",\n \"0px\",\n style.getPropertyPriority(\"min-height\")\n );\n }\n const children = contentChildren(element);\n element = children.length === 1 ? children[0] : undefined;\n }\n }\n};\n"],"names":["normalizeContentViewportMinHeight","container","contentChildren","element","child","root","style","children"],"mappings":"AACO,MAAMA,IAAoC,CAACC,MAA2B;AAC3E,QAAMC,IAAkB,CAACC,MACvB,MAAM,KAAKA,EAAQ,QAAQ,EAAE;AAAA,IAC3B,CAACC,MAAU,CAAC,CAAC,SAAS,UAAU,MAAM,EAAE,SAASA,EAAM,OAAO;AAAA,EAAA;AAGlE,aAAWC,KAAQH,EAAgBD,CAAS,GAAG;AAC7C,QAAIE,IAA+BE;AACnC,WAAOF,KAAS;AACd,YAAMG,IAASH,EAAwB;AAIvC,MAAI,2BAA2B,KAAKG,GAAO,UAAU,KAAA,KAAU,EAAE,KAC/DA,EAAM;AAAA,QACJ;AAAA,QACA;AAAA,QACAA,EAAM,oBAAoB,YAAY;AAAA,MAAA;AAG1C,YAAMC,IAAWL,EAAgBC,CAAO;AACxC,MAAAA,IAAUI,EAAS,WAAW,IAAIA,EAAS,CAAC,IAAI;AAAA,IAClD;AAAA,EACF;AACF;"}
1
+ {"version":3,"file":"content-viewport-min-height.es.js","sources":["../../../../src/components/ContentRender/utils/content-viewport-min-height.ts"],"sourcesContent":["/** Let full-viewport minimum-height shells fit the surrounding lesson flow. */\nexport const normalizeContentViewportMinHeight = (container: HTMLElement) => {\n const hasRenderedText = (element: Element) =>\n Array.from(element.childNodes).some(\n (node) => node.nodeType === 3 && Boolean(node.textContent?.trim())\n );\n if (hasRenderedText(container)) return;\n const contentChildren = (element: Element) =>\n Array.from(element.children).filter(\n (child) => ![\"STYLE\", \"SCRIPT\", \"LINK\"].includes(child.tagName)\n );\n\n for (const root of contentChildren(container)) {\n let element: Element | undefined = root;\n while (element) {\n const style = (element as HTMLElement).style;\n // Normalize only a full-screen minimum, never an explicit height, pixel\n // minimum, padding, margin, or viewport-relative font size. The iframe\n // retains its stable layout viewport for vh/vmin-dependent content.\n if (/^100(?:dvh|svh|lvh|vh)$/i.test(style?.minHeight.trim() ?? \"\")) {\n style.setProperty(\n \"min-height\",\n \"0px\",\n style.getPropertyPriority(\"min-height\")\n );\n }\n // Text plus an element is content, not a single-child wrapper.\n if (hasRenderedText(element)) break;\n const children = contentChildren(element);\n element = children.length === 1 ? children[0] : undefined;\n }\n }\n};\n"],"names":["normalizeContentViewportMinHeight","container","hasRenderedText","element","node","contentChildren","child","root","style","children"],"mappings":"AACO,MAAMA,IAAoC,CAACC,MAA2B;AAC3E,QAAMC,IAAkB,CAACC,MACvB,MAAM,KAAKA,EAAQ,UAAU,EAAE;AAAA,IAC7B,CAACC,MAASA,EAAK,aAAa,KAAK,EAAQA,EAAK,aAAa,KAAA;AAAA,EAAM;AAErE,MAAIF,EAAgBD,CAAS,EAAG;AAChC,QAAMI,IAAkB,CAACF,MACvB,MAAM,KAAKA,EAAQ,QAAQ,EAAE;AAAA,IAC3B,CAACG,MAAU,CAAC,CAAC,SAAS,UAAU,MAAM,EAAE,SAASA,EAAM,OAAO;AAAA,EAAA;AAGlE,aAAWC,KAAQF,EAAgBJ,CAAS,GAAG;AAC7C,QAAIE,IAA+BI;AACnC,WAAOJ,KAAS;AACd,YAAMK,IAASL,EAAwB;AAYvC,UARI,2BAA2B,KAAKK,GAAO,UAAU,KAAA,KAAU,EAAE,KAC/DA,EAAM;AAAA,QACJ;AAAA,QACA;AAAA,QACAA,EAAM,oBAAoB,YAAY;AAAA,MAAA,GAItCN,EAAgBC,CAAO,EAAG;AAC9B,YAAMM,IAAWJ,EAAgBF,CAAO;AACxC,MAAAA,IAAUM,EAAS,WAAW,IAAIA,EAAS,CAAC,IAAI;AAAA,IAClD;AAAA,EACF;AACF;"}
package/package.json CHANGED
@@ -187,7 +187,7 @@
187
187
  ]
188
188
  }
189
189
  },
190
- "version": "0.2.35-dev.1",
190
+ "version": "0.2.35-dev.2",
191
191
  "type": "module",
192
192
  "exports": {
193
193
  ".": {