dsh-claude-slides 2.8.0 → 2.8.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.
@@ -8,7 +8,7 @@
8
8
  <script id="appifact-mode">(function(){var h=document.documentElement;function s(){var t=h.getAttribute('data-theme');if(t==='light'||t==='dark'){h.setAttribute('data-mode',t)}else{h.removeAttribute('data-mode')}}s();if(typeof MutationObserver==='function'){new MutationObserver(s).observe(h,{attributes:true,attributeFilter:['data-theme']})}})();</script>
9
9
  <script id="appifact-flags">(function(){var values={slides_theme_tab:true,appifact_icon_set:true,appifact_bottom_toolbar:false,appifact_extra_export_formats:window.parent===window};function kind(v){return v===null?"null":Array.isArray(v)?"array":typeof v}function copy(v){return JSON.parse(JSON.stringify(v))}globalThis.__appifact_flags={version:"appifact-flags:v1",ready:function(){return Promise.resolve(true)},get:function(key,fallback){if(!Object.prototype.hasOwnProperty.call(values,key)||kind(values[key])!==kind(fallback))return fallback;return copy(values[key])},all:function(){return copy(values)}};})();</script>
10
10
  <title>Slides</title>
11
- <script type="module" crossorigin src="./assets/index-kN-1njux.js"></script>
11
+ <script type="module" crossorigin src="./assets/index-7OEzB54c.js"></script>
12
12
  <link rel="stylesheet" crossorigin href="./assets/index-DX-X-CY8.css">
13
13
  </head>
14
14
  <body>
@@ -28302,6 +28302,7 @@ var require_pptxgen_cjs = __commonJS({
28302
28302
  "color",
28303
28303
  "fill",
28304
28304
  "fontFace",
28305
+ "eaFontFace",
28305
28306
  "fontPitchFamily",
28306
28307
  "fontSize",
28307
28308
  "margin",
@@ -28700,7 +28701,7 @@ var require_pptxgen_cjs = __commonJS({
28700
28701
  runProps += `<a:effectLst>${createGlowElement(opts.glow, DEF_TEXT_GLOW)}</a:effectLst>`;
28701
28702
  if (opts.fontFace) {
28702
28703
  let Y = opts.fontPitchFamily ?? 34;
28703
- runProps += `<a:latin typeface="${opts.fontFace}" pitchFamily="${Y}" charset="0"/><a:ea typeface="${opts.fontFace}" pitchFamily="${Y}" charset="-122"/><a:cs typeface="${opts.fontFace}" pitchFamily="${Y}" charset="-120"/>`;
28704
+ runProps += `<a:latin typeface="${opts.fontFace}" pitchFamily="${Y}" charset="0"/>${opts.eaFontFace ? `<a:ea typeface="${opts.eaFontFace}"/>` : `<a:ea typeface="${opts.fontFace}" pitchFamily="${Y}" charset="-122"/>`}<a:cs typeface="${opts.fontFace}" pitchFamily="${Y}" charset="-120"/>`;
28704
28705
  }
28705
28706
  }
28706
28707
  if (opts.hyperlink) {
@@ -28821,7 +28822,7 @@ var require_pptxgen_cjs = __commonJS({
28821
28822
  reqsClosingFontSize = true, opts.fontSize = opts.fontSize || textObj.options.fontSize;
28822
28823
  }), opts.fontFace || slideObj._type === "tablecell" && opts.fontSize) {
28823
28824
  if (opts.fontFace)
28824
- strSlideXml += `<a:endParaRPr lang="${opts.lang || "en-US"}"` + (opts.fontSize ? ` sz="${Math.round(opts.fontSize * 100)}"` : "") + ' dirty="0">', strSlideXml += `<a:latin typeface="${opts.fontFace}" charset="0"/>`, strSlideXml += `<a:ea typeface="${opts.fontFace}" charset="0"/>`, strSlideXml += `<a:cs typeface="${opts.fontFace}" charset="0"/>`, strSlideXml += "</a:endParaRPr>";
28825
+ strSlideXml += `<a:endParaRPr lang="${opts.lang || "en-US"}"` + (opts.fontSize ? ` sz="${Math.round(opts.fontSize * 100)}"` : "") + ' dirty="0">', strSlideXml += `<a:latin typeface="${opts.fontFace}" charset="0"/>`, strSlideXml += opts.eaFontFace ? `<a:ea typeface="${opts.eaFontFace}"/>` : `<a:ea typeface="${opts.fontFace}" charset="0"/>`, strSlideXml += `<a:cs typeface="${opts.fontFace}" charset="0"/>`, strSlideXml += "</a:endParaRPr>";
28825
28826
  else
28826
28827
  strSlideXml += `<a:endParaRPr lang="${opts.lang || "en-US"}"` + (opts.fontSize ? ` sz="${Math.round(opts.fontSize * 100)}"` : "") + ' dirty="0"/>';
28827
28828
  } else if (reqsClosingFontSize)
@@ -155024,6 +155025,48 @@ function installExportFontTables(runtime2) {
155024
155025
  });
155025
155026
  return out;
155026
155027
  }
155028
+ function fontCodePoints(bytes) {
155029
+ let codePoints = /* @__PURE__ */ new Set();
155030
+ try {
155031
+ let view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength), cmap;
155032
+ for (let index4 = 0; index4 < view.getUint16(4); index4++) {
155033
+ if (view.getUint32(12 + index4 * 16) === 1668112752) {
155034
+ cmap = view.getUint32(12 + index4 * 16 + 8);
155035
+ }
155036
+ }
155037
+ if (cmap === void 0) {
155038
+ return codePoints;
155039
+ }
155040
+ for (let index4 = 0; index4 < view.getUint16(cmap + 2); index4++) {
155041
+ let at = cmap + view.getUint32(cmap + 8 + index4 * 8), format = view.getUint16(at);
155042
+ if (format === 12) {
155043
+ for (let group = 0; group < view.getUint32(at + 12); group++) {
155044
+ let last = view.getUint32(at + 20 + group * 12);
155045
+ for (let code = view.getUint32(at + 16 + group * 12); code <= last; code++) {
155046
+ codePoints.add(code);
155047
+ }
155048
+ }
155049
+ } else if (format === 4) {
155050
+ let segments = view.getUint16(at + 6) / 2, starts = at + 16 + segments * 2, deltas = starts + segments * 2, offsets = deltas + segments * 2;
155051
+ for (let segment = 0; segment < segments; segment++) {
155052
+ let last = view.getUint16(at + 14 + segment * 2), first = view.getUint16(starts + segment * 2), delta = view.getUint16(deltas + segment * 2), offset4 = view.getUint16(offsets + segment * 2);
155053
+ for (let code = first; code <= last && code !== 65535; code++) {
155054
+ let glyph = offset4 === 0 ? code : view.getUint16(offsets + segment * 2 + offset4 + (code - first) * 2);
155055
+ if (offset4 !== 0 && glyph === 0) {
155056
+ continue;
155057
+ }
155058
+ if ((glyph + delta & 65535) !== 0) {
155059
+ codePoints.add(code);
155060
+ }
155061
+ }
155062
+ }
155063
+ }
155064
+ }
155065
+ } catch {
155066
+ return /* @__PURE__ */ new Set();
155067
+ }
155068
+ return codePoints;
155069
+ }
155027
155070
  function renameFontFace(bytes, family, subfamily, style) {
155028
155071
  if (bytes.byteLength < 12) {
155029
155072
  return bytes;
@@ -155312,6 +155355,7 @@ function installExportFontTables(runtime2) {
155312
155355
  return references;
155313
155356
  }
155314
155357
  bindRuntimeValue(runtime2, "readFontTables", () => readFontTables);
155358
+ bindRuntimeValue(runtime2, "fontCodePoints", () => fontCodePoints);
155315
155359
  bindRuntimeValue(runtime2, "renameFontFace", () => renameFontFace);
155316
155360
  bindRuntimeValue(
155317
155361
  runtime2,
@@ -156085,6 +156129,21 @@ function installExportPptx(runtime2) {
156085
156129
  };
156086
156130
  }
156087
156131
  }
156132
+ let embeddedCodePoints;
156133
+ function pptxEastAsianFace(face, text) {
156134
+ if (embeddedCodePoints === void 0 || !/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u.test(text)) {
156135
+ return {};
156136
+ }
156137
+ let cuts = embeddedCodePoints.get(face.toLowerCase());
156138
+ if (cuts !== void 0 && [...text.replace(/\s/g, "")].every(
156139
+ (character) => cuts.every((cut) => cut.has(character.codePointAt(0)))
156140
+ )) {
156141
+ return {};
156142
+ }
156143
+ return {
156144
+ eaFontFace: /\bJP\b/.test(face) || /[\p{Script=Hiragana}\p{Script=Katakana}]/u.test(text) ? "Yu Gothic" : /\bKR\b/.test(face) || /\p{Script=Hangul}/u.test(text) ? "Malgun Gothic" : /\b(TC|HK)\b/.test(face) ? "Microsoft JhengHei" : "Microsoft YaHei"
156145
+ };
156146
+ }
156088
156147
  function pptxFontFace(role, font) {
156089
156148
  if (font !== void 0 && typeof font !== "string") {
156090
156149
  return font.family;
@@ -156494,7 +156553,13 @@ function installExportPptx(runtime2) {
156494
156553
  });
156495
156554
  presentation.layout = "APPIFACT";
156496
156555
  presentation.description = options.description ?? "";
156556
+ embeddedCodePoints = options.forGoogleSlides === true ? void 0 : /* @__PURE__ */ new Map();
156497
156557
  for (let font of options.embeddedFonts ?? []) {
156558
+ let family = font.typeface.toLowerCase();
156559
+ embeddedCodePoints?.set(family, [
156560
+ ...embeddedCodePoints.get(family) ?? [],
156561
+ (0, runtime2.fontCodePoints)(font.data)
156562
+ ]);
156498
156563
  presentation.addEmbeddedFont({
156499
156564
  typeface: font.typeface,
156500
156565
  style: font.style,
@@ -157013,6 +157078,7 @@ function installExportPptx(runtime2) {
157013
157078
  points: value18
157014
157079
  } : {},
157015
157080
  fontFace: pptxFontFace(leaf.role, leaf.fontFamily),
157081
+ ...pptxEastAsianFace(pptxFontFace(leaf.role, leaf.fontFamily), leaf.text),
157016
157082
  fontPitchFamily: pptxFontFamilyPitch(leaf.role, leaf.fontFamily),
157017
157083
  fontSize: pxToPoints(value3),
157018
157084
  bold: value4 >= 600,
@@ -158073,6 +158139,7 @@ function installExportPptx(runtime2) {
158073
158139
  )
158074
158140
  } : {},
158075
158141
  fontFace: pptxFontFace(value, leaf.fontFamily),
158142
+ ...pptxEastAsianFace(pptxFontFace(value, leaf.fontFamily), leaf.rows.flat().join("")),
158076
158143
  fontPitchFamily: pptxFontFamilyPitch(value, leaf.fontFamily),
158077
158144
  fontSize: pxToPoints(state.fontSize),
158078
158145
  color: hexToPptxColor(value5).color,