omni-viewer-core 0.1.0
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/LICENSE +21 -0
- package/README.md +80 -0
- package/THIRD_PARTY_NOTICES.md +49 -0
- package/dist/assets/audio-engine/audio_engine.mjs +2 -0
- package/dist/assets/audio-engine/audio_engine.wasm +0 -0
- package/dist/assets/pdfjs/pdf.worker.min.mjs +21 -0
- package/dist/host/index.d.ts +133 -0
- package/dist/host/index.js +10 -0
- package/dist/i18n/catalog.en.d.ts +1 -0
- package/dist/i18n/catalog.en.js +411 -0
- package/dist/i18n/catalog.ko.d.ts +1 -0
- package/dist/i18n/catalog.ko.js +68 -0
- package/dist/i18n/index.d.ts +18 -0
- package/dist/i18n/index.js +41 -0
- package/dist/licenses/emscripten.txt +101 -0
- package/dist/licenses/kissfft.txt +28 -0
- package/dist/licenses/pdfjs-dist.txt +177 -0
- package/dist/parsers/a2l/index.d.ts +1 -0
- package/dist/parsers/a2l/index.js +1 -0
- package/dist/parsers/archive/index.d.ts +22 -0
- package/dist/parsers/archive/index.js +46 -0
- package/dist/parsers/archive/model.d.ts +29 -0
- package/dist/parsers/archive/model.js +1 -0
- package/dist/parsers/archive/worker.d.ts +21 -0
- package/dist/parsers/archive/worker.js +1 -0
- package/dist/parsers/arxml/index.d.ts +1 -0
- package/dist/parsers/arxml/index.js +1 -0
- package/dist/parsers/asc/index.d.ts +1 -0
- package/dist/parsers/asc/index.js +1 -0
- package/dist/parsers/audio/index.d.ts +9 -0
- package/dist/parsers/audio/index.js +46 -0
- package/dist/parsers/automotive/index.d.ts +33 -0
- package/dist/parsers/automotive/index.js +973 -0
- package/dist/parsers/blf/index.d.ts +1 -0
- package/dist/parsers/blf/index.js +1 -0
- package/dist/parsers/csv/delimiter.d.ts +31 -0
- package/dist/parsers/csv/delimiter.js +151 -0
- package/dist/parsers/csv/index.d.ts +30 -0
- package/dist/parsers/csv/index.js +108 -0
- package/dist/parsers/csv/parseText.d.ts +20 -0
- package/dist/parsers/csv/parseText.js +108 -0
- package/dist/parsers/csv/sort.d.ts +26 -0
- package/dist/parsers/csv/sort.js +224 -0
- package/dist/parsers/csv/statistics.d.ts +49 -0
- package/dist/parsers/csv/statistics.js +150 -0
- package/dist/parsers/dbc/index.d.ts +56 -0
- package/dist/parsers/dbc/index.js +94 -0
- package/dist/parsers/doc-binary/index.d.ts +35 -0
- package/dist/parsers/doc-binary/index.js +267 -0
- package/dist/parsers/doc-binary/vscode-parser.d.ts +142 -0
- package/dist/parsers/doc-binary/vscode-parser.js +3747 -0
- package/dist/parsers/excel/index.d.ts +17 -0
- package/dist/parsers/excel/index.js +406 -0
- package/dist/parsers/excel/model.d.ts +80 -0
- package/dist/parsers/excel/model.js +48 -0
- package/dist/parsers/excel/serialize.d.ts +3 -0
- package/dist/parsers/excel/serialize.js +78 -0
- package/dist/parsers/hdf5/index.d.ts +75 -0
- package/dist/parsers/hdf5/index.js +658 -0
- package/dist/parsers/hdf5/node.d.ts +21 -0
- package/dist/parsers/hdf5/node.js +95 -0
- package/dist/parsers/json/index.d.ts +15 -0
- package/dist/parsers/json/index.js +102 -0
- package/dist/parsers/json/model.d.ts +42 -0
- package/dist/parsers/json/model.js +140 -0
- package/dist/parsers/json/parse.d.ts +22 -0
- package/dist/parsers/json/parse.js +279 -0
- package/dist/parsers/json/tokenizer.d.ts +17 -0
- package/dist/parsers/json/tokenizer.js +175 -0
- package/dist/parsers/jsonl/index.d.ts +14 -0
- package/dist/parsers/jsonl/index.js +18 -0
- package/dist/parsers/jsonl/model.d.ts +23 -0
- package/dist/parsers/jsonl/model.js +1 -0
- package/dist/parsers/jsonl/parse.d.ts +7 -0
- package/dist/parsers/jsonl/parse.js +34 -0
- package/dist/parsers/markdown/index.d.ts +37 -0
- package/dist/parsers/markdown/index.js +59 -0
- package/dist/parsers/mat/index.d.ts +31 -0
- package/dist/parsers/mat/index.js +426 -0
- package/dist/parsers/mermaid/index.d.ts +5 -0
- package/dist/parsers/mermaid/index.js +3 -0
- package/dist/parsers/mf4/index.d.ts +1 -0
- package/dist/parsers/mf4/index.js +1 -0
- package/dist/parsers/parquet/index.d.ts +21 -0
- package/dist/parsers/parquet/index.js +68 -0
- package/dist/parsers/pcap/index.d.ts +1 -0
- package/dist/parsers/pcap/index.js +1 -0
- package/dist/parsers/pcapng/index.d.ts +1 -0
- package/dist/parsers/pcapng/index.js +1 -0
- package/dist/parsers/plantuml/index.d.ts +5 -0
- package/dist/parsers/plantuml/index.js +4 -0
- package/dist/parsers/ppt-binary/index.d.ts +5 -0
- package/dist/parsers/ppt-binary/index.js +62 -0
- package/dist/parsers/ppt-binary/pptBinaryBuildContext.d.ts +12 -0
- package/dist/parsers/ppt-binary/pptBinaryBuildContext.js +40 -0
- package/dist/parsers/ppt-binary/pptBinaryContainer.d.ts +4 -0
- package/dist/parsers/ppt-binary/pptBinaryContainer.js +174 -0
- package/dist/parsers/ppt-binary/pptBinaryTypes.d.ts +125 -0
- package/dist/parsers/ppt-binary/pptBinaryTypes.js +1 -0
- package/dist/parsers/ppt-binary/pptSlideLayouts.d.ts +9 -0
- package/dist/parsers/ppt-binary/pptSlideLayouts.js +510 -0
- package/dist/parsers/ppt-binary/vscode-parser.d.ts +116 -0
- package/dist/parsers/ppt-binary/vscode-parser.js +2853 -0
- package/dist/parsers/ppt-binary/vscode.d.ts +4 -0
- package/dist/parsers/ppt-binary/vscode.js +12 -0
- package/dist/parsers/pptx/index.d.ts +15 -0
- package/dist/parsers/pptx/index.js +88 -0
- package/dist/parsers/pptx/vscode-parser.d.ts +167 -0
- package/dist/parsers/pptx/vscode-parser.js +1503 -0
- package/dist/parsers/pptx/vscode.d.ts +4 -0
- package/dist/parsers/pptx/vscode.js +18 -0
- package/dist/parsers/pptx/zip-reader.d.ts +3 -0
- package/dist/parsers/pptx/zip-reader.js +20 -0
- package/dist/parsers/proto/index.d.ts +90 -0
- package/dist/parsers/proto/index.js +197 -0
- package/dist/parsers/psd/index.d.ts +16 -0
- package/dist/parsers/psd/index.js +10 -0
- package/dist/parsers/shapefile/dbf.d.ts +23 -0
- package/dist/parsers/shapefile/dbf.js +112 -0
- package/dist/parsers/shapefile/index.d.ts +44 -0
- package/dist/parsers/shapefile/index.js +119 -0
- package/dist/parsers/shapefile/reproject.d.ts +10 -0
- package/dist/parsers/shapefile/reproject.js +41 -0
- package/dist/parsers/slide-model.d.ts +106 -0
- package/dist/parsers/slide-model.js +1 -0
- package/dist/parsers/toml/index.d.ts +15 -0
- package/dist/parsers/toml/index.js +18 -0
- package/dist/parsers/toml/model.d.ts +15 -0
- package/dist/parsers/toml/model.js +1 -0
- package/dist/parsers/toml/parse.d.ts +16 -0
- package/dist/parsers/toml/parse.js +266 -0
- package/dist/parsers/types.d.ts +103 -0
- package/dist/parsers/types.js +106 -0
- package/dist/parsers/video/index.d.ts +6 -0
- package/dist/parsers/video/index.js +2 -0
- package/dist/parsers/yaml/index.d.ts +16 -0
- package/dist/parsers/yaml/index.js +58 -0
- package/dist/parsers/yaml/model.d.ts +22 -0
- package/dist/parsers/yaml/model.js +1 -0
- package/dist/parsers/yaml/self-loading.d.ts +3 -0
- package/dist/parsers/yaml/self-loading.js +19 -0
- package/dist/parsers/zip-scan.d.ts +8 -0
- package/dist/parsers/zip-scan.js +80 -0
- package/dist/registry/container.d.ts +17 -0
- package/dist/registry/container.js +49 -0
- package/dist/registry/index.d.ts +133 -0
- package/dist/registry/index.js +348 -0
- package/dist/registry/probe.d.ts +3 -0
- package/dist/registry/probe.js +177 -0
- package/dist/registry/sniff.d.ts +17 -0
- package/dist/registry/sniff.js +57 -0
- package/dist/styles/archive.css +10 -0
- package/dist/styles/audio.css +66 -0
- package/dist/styles/automotive.css +1 -0
- package/dist/styles/csv.css +262 -0
- package/dist/styles/excel.css +212 -0
- package/dist/styles/fallback.css +48 -0
- package/dist/styles/hdf5.css +3 -0
- package/dist/styles/hwp.css +12 -0
- package/dist/styles/image.css +115 -0
- package/dist/styles/json.css +342 -0
- package/dist/styles/jsonl.css +1 -0
- package/dist/styles/markdown.css +10 -0
- package/dist/styles/mat.css +2 -0
- package/dist/styles/mermaid.css +1 -0
- package/dist/styles/parquet.css +2 -0
- package/dist/styles/pdf.css +551 -0
- package/dist/styles/plantuml.css +1 -0
- package/dist/styles/ppt.css +1 -0
- package/dist/styles/proto.css +2 -0
- package/dist/styles/psd.css +1 -0
- package/dist/styles/shapefile.css +25 -0
- package/dist/styles/toml.css +1 -0
- package/dist/styles/video.css +74 -0
- package/dist/styles/word.css +685 -0
- package/dist/styles/yaml.css +1 -0
- package/dist/viewers/a2l/index.d.ts +15 -0
- package/dist/viewers/a2l/index.js +5 -0
- package/dist/viewers/archive/archive-preview-decoder.d.ts +4 -0
- package/dist/viewers/archive/archive-preview-decoder.js +223 -0
- package/dist/viewers/archive/controller.d.ts +24 -0
- package/dist/viewers/archive/controller.js +18 -0
- package/dist/viewers/archive/index.d.ts +25 -0
- package/dist/viewers/archive/index.js +230 -0
- package/dist/viewers/archive/preview.d.ts +2 -0
- package/dist/viewers/archive/preview.js +2 -0
- package/dist/viewers/archive/styles.d.ts +1 -0
- package/dist/viewers/archive/styles.js +11 -0
- package/dist/viewers/arxml/index.d.ts +15 -0
- package/dist/viewers/arxml/index.js +5 -0
- package/dist/viewers/asc/index.d.ts +15 -0
- package/dist/viewers/asc/index.js +5 -0
- package/dist/viewers/audio/controller.d.ts +33 -0
- package/dist/viewers/audio/controller.js +49 -0
- package/dist/viewers/audio/engine.d.ts +44 -0
- package/dist/viewers/audio/engine.js +108 -0
- package/dist/viewers/audio/index.d.ts +92 -0
- package/dist/viewers/audio/index.js +448 -0
- package/dist/viewers/audio/self-loading.d.ts +7 -0
- package/dist/viewers/audio/self-loading.js +42 -0
- package/dist/viewers/audio/styles.d.ts +1 -0
- package/dist/viewers/audio/styles.js +73 -0
- package/dist/viewers/automotive/index.d.ts +8 -0
- package/dist/viewers/automotive/index.js +152 -0
- package/dist/viewers/automotive/styles.d.ts +1 -0
- package/dist/viewers/automotive/styles.js +1 -0
- package/dist/viewers/avro/index.d.ts +15 -0
- package/dist/viewers/avro/index.js +5 -0
- package/dist/viewers/bag/index.d.ts +15 -0
- package/dist/viewers/bag/index.js +5 -0
- package/dist/viewers/blf/index.d.ts +15 -0
- package/dist/viewers/blf/index.js +5 -0
- package/dist/viewers/csv/controller.d.ts +126 -0
- package/dist/viewers/csv/controller.js +598 -0
- package/dist/viewers/csv/index.d.ts +48 -0
- package/dist/viewers/csv/index.js +846 -0
- package/dist/viewers/csv/styles.d.ts +1 -0
- package/dist/viewers/csv/styles.js +267 -0
- package/dist/viewers/db3/index.d.ts +15 -0
- package/dist/viewers/db3/index.js +5 -0
- package/dist/viewers/dbc/index.d.ts +15 -0
- package/dist/viewers/dbc/index.js +5 -0
- package/dist/viewers/diagram.d.ts +14 -0
- package/dist/viewers/diagram.js +95 -0
- package/dist/viewers/excel/controller.d.ts +108 -0
- package/dist/viewers/excel/controller.js +548 -0
- package/dist/viewers/excel/grid.d.ts +28 -0
- package/dist/viewers/excel/grid.js +99 -0
- package/dist/viewers/excel/index.d.ts +37 -0
- package/dist/viewers/excel/index.js +620 -0
- package/dist/viewers/excel/self-loading.d.ts +6 -0
- package/dist/viewers/excel/self-loading.js +13 -0
- package/dist/viewers/excel/styles.d.ts +1 -0
- package/dist/viewers/excel/styles.js +216 -0
- package/dist/viewers/fallback/index.d.ts +17 -0
- package/dist/viewers/fallback/index.js +130 -0
- package/dist/viewers/fallback/styles.d.ts +1 -0
- package/dist/viewers/fallback/styles.js +49 -0
- package/dist/viewers/hdf5/index.d.ts +19 -0
- package/dist/viewers/hdf5/index.js +170 -0
- package/dist/viewers/hdf5/styles.d.ts +1 -0
- package/dist/viewers/hdf5/styles.js +4 -0
- package/dist/viewers/hwp/controller.d.ts +19 -0
- package/dist/viewers/hwp/controller.js +22 -0
- package/dist/viewers/hwp/index.d.ts +39 -0
- package/dist/viewers/hwp/index.js +271 -0
- package/dist/viewers/hwp/self-loading.d.ts +2 -0
- package/dist/viewers/hwp/self-loading.js +6 -0
- package/dist/viewers/hwp/styles.d.ts +1 -0
- package/dist/viewers/hwp/styles.js +13 -0
- package/dist/viewers/image/controller.d.ts +210 -0
- package/dist/viewers/image/controller.js +336 -0
- package/dist/viewers/image/decode.d.ts +54 -0
- package/dist/viewers/image/decode.js +150 -0
- package/dist/viewers/image/index.d.ts +38 -0
- package/dist/viewers/image/index.js +749 -0
- package/dist/viewers/image/limits.d.ts +18 -0
- package/dist/viewers/image/limits.js +20 -0
- package/dist/viewers/image/styles.d.ts +1 -0
- package/dist/viewers/image/styles.js +119 -0
- package/dist/viewers/json/controller.d.ts +89 -0
- package/dist/viewers/json/controller.js +411 -0
- package/dist/viewers/json/index.d.ts +25 -0
- package/dist/viewers/json/index.js +503 -0
- package/dist/viewers/json/styles.d.ts +1 -0
- package/dist/viewers/json/styles.js +346 -0
- package/dist/viewers/json/transforms.d.ts +27 -0
- package/dist/viewers/json/transforms.js +253 -0
- package/dist/viewers/jsonl/controller.d.ts +48 -0
- package/dist/viewers/jsonl/controller.js +136 -0
- package/dist/viewers/jsonl/index.d.ts +22 -0
- package/dist/viewers/jsonl/index.js +184 -0
- package/dist/viewers/jsonl/styles.d.ts +1 -0
- package/dist/viewers/jsonl/styles.js +1 -0
- package/dist/viewers/markdown/controller.d.ts +50 -0
- package/dist/viewers/markdown/controller.js +62 -0
- package/dist/viewers/markdown/index.d.ts +64 -0
- package/dist/viewers/markdown/index.js +425 -0
- package/dist/viewers/markdown/math.d.ts +21 -0
- package/dist/viewers/markdown/math.js +100 -0
- package/dist/viewers/markdown/self-loading.d.ts +5 -0
- package/dist/viewers/markdown/self-loading.js +48 -0
- package/dist/viewers/markdown/styles.d.ts +1 -0
- package/dist/viewers/markdown/styles.js +11 -0
- package/dist/viewers/mat/index.d.ts +19 -0
- package/dist/viewers/mat/index.js +113 -0
- package/dist/viewers/mat/styles.d.ts +1 -0
- package/dist/viewers/mat/styles.js +3 -0
- package/dist/viewers/media.d.ts +9 -0
- package/dist/viewers/media.js +77 -0
- package/dist/viewers/mermaid/index.d.ts +17 -0
- package/dist/viewers/mermaid/index.js +6 -0
- package/dist/viewers/mermaid/self-loading.d.ts +2 -0
- package/dist/viewers/mermaid/self-loading.js +2 -0
- package/dist/viewers/mf4/index.d.ts +15 -0
- package/dist/viewers/mf4/index.js +5 -0
- package/dist/viewers/parquet/controller.d.ts +37 -0
- package/dist/viewers/parquet/controller.js +26 -0
- package/dist/viewers/parquet/index.d.ts +23 -0
- package/dist/viewers/parquet/index.js +134 -0
- package/dist/viewers/parquet/styles.d.ts +1 -0
- package/dist/viewers/parquet/styles.js +3 -0
- package/dist/viewers/pcap/index.d.ts +15 -0
- package/dist/viewers/pcap/index.js +5 -0
- package/dist/viewers/pcapng/index.d.ts +15 -0
- package/dist/viewers/pcapng/index.js +5 -0
- package/dist/viewers/pdf/controller.d.ts +120 -0
- package/dist/viewers/pdf/controller.js +191 -0
- package/dist/viewers/pdf/editing.d.ts +26 -0
- package/dist/viewers/pdf/editing.js +265 -0
- package/dist/viewers/pdf/index.d.ts +88 -0
- package/dist/viewers/pdf/index.js +1400 -0
- package/dist/viewers/pdf/self-loading.d.ts +6 -0
- package/dist/viewers/pdf/self-loading.js +14 -0
- package/dist/viewers/pdf/styles.d.ts +1 -0
- package/dist/viewers/pdf/styles.js +555 -0
- package/dist/viewers/plantuml/index.d.ts +17 -0
- package/dist/viewers/plantuml/index.js +6 -0
- package/dist/viewers/plantuml/self-loading.d.ts +2 -0
- package/dist/viewers/plantuml/self-loading.js +2 -0
- package/dist/viewers/ppt/chart.d.ts +8 -0
- package/dist/viewers/ppt/chart.js +83 -0
- package/dist/viewers/ppt/controller.d.ts +34 -0
- package/dist/viewers/ppt/controller.js +27 -0
- package/dist/viewers/ppt/index.d.ts +33 -0
- package/dist/viewers/ppt/index.js +101 -0
- package/dist/viewers/ppt/render.d.ts +5 -0
- package/dist/viewers/ppt/render.js +144 -0
- package/dist/viewers/ppt/self-loading.d.ts +9 -0
- package/dist/viewers/ppt/self-loading.js +4 -0
- package/dist/viewers/ppt/styles.d.ts +1 -0
- package/dist/viewers/ppt/styles.js +1 -0
- package/dist/viewers/proto/index.d.ts +17 -0
- package/dist/viewers/proto/index.js +170 -0
- package/dist/viewers/proto/styles.d.ts +1 -0
- package/dist/viewers/proto/styles.js +2 -0
- package/dist/viewers/psd/index.d.ts +27 -0
- package/dist/viewers/psd/index.js +39 -0
- package/dist/viewers/psd/self-loading.d.ts +10 -0
- package/dist/viewers/psd/self-loading.js +20 -0
- package/dist/viewers/psd/styles.d.ts +1 -0
- package/dist/viewers/psd/styles.js +1 -0
- package/dist/viewers/reqif/index.d.ts +15 -0
- package/dist/viewers/reqif/index.js +5 -0
- package/dist/viewers/shapefile/index.d.ts +35 -0
- package/dist/viewers/shapefile/index.js +336 -0
- package/dist/viewers/shapefile/self-loading.d.ts +7 -0
- package/dist/viewers/shapefile/self-loading.js +32 -0
- package/dist/viewers/shapefile/styles.d.ts +1 -0
- package/dist/viewers/shapefile/styles.js +28 -0
- package/dist/viewers/stp/index.d.ts +15 -0
- package/dist/viewers/stp/index.js +5 -0
- package/dist/viewers/structured-styles.d.ts +1 -0
- package/dist/viewers/structured-styles.js +1 -0
- package/dist/viewers/structured.d.ts +36 -0
- package/dist/viewers/structured.js +138 -0
- package/dist/viewers/toml/controller.d.ts +38 -0
- package/dist/viewers/toml/controller.js +61 -0
- package/dist/viewers/toml/index.d.ts +18 -0
- package/dist/viewers/toml/index.js +34 -0
- package/dist/viewers/types.d.ts +36 -0
- package/dist/viewers/types.js +9 -0
- package/dist/viewers/video/controller.d.ts +29 -0
- package/dist/viewers/video/controller.js +54 -0
- package/dist/viewers/video/index.d.ts +18 -0
- package/dist/viewers/video/index.js +305 -0
- package/dist/viewers/video/styles.d.ts +1 -0
- package/dist/viewers/video/styles.js +79 -0
- package/dist/viewers/word/controller.d.ts +19 -0
- package/dist/viewers/word/controller.js +22 -0
- package/dist/viewers/word/docx-preprocess.d.ts +63 -0
- package/dist/viewers/word/docx-preprocess.js +136 -0
- package/dist/viewers/word/index.d.ts +32 -0
- package/dist/viewers/word/index.js +187 -0
- package/dist/viewers/word/normalize-docx.d.ts +2 -0
- package/dist/viewers/word/normalize-docx.js +50 -0
- package/dist/viewers/word/paginate.d.ts +1 -0
- package/dist/viewers/word/paginate.js +1035 -0
- package/dist/viewers/word/self-loading.d.ts +2 -0
- package/dist/viewers/word/self-loading.js +7 -0
- package/dist/viewers/word/styles.d.ts +1 -0
- package/dist/viewers/word/styles.js +686 -0
- package/dist/viewers/yaml/controller.d.ts +42 -0
- package/dist/viewers/yaml/controller.js +41 -0
- package/dist/viewers/yaml/index.d.ts +21 -0
- package/dist/viewers/yaml/index.js +20 -0
- package/package.json +375 -0
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
export function applyActivityProcessLayoutImpl(elements, styledShapeBlocks, masterRecord, picturesById, presentationMetrics, slideWidth, slideHeight, applyMasterBackgroundImage) {
|
|
2
|
+
applyMasterBackgroundImage(elements, masterRecord, picturesById, presentationMetrics, slideWidth, slideHeight);
|
|
3
|
+
for (let index = elements.length - 1; index >= 0; index--) {
|
|
4
|
+
const element = elements[index];
|
|
5
|
+
if (element.type === 'shape') {
|
|
6
|
+
elements.splice(index, 1);
|
|
7
|
+
continue;
|
|
8
|
+
}
|
|
9
|
+
if (element.type === 'image') {
|
|
10
|
+
elements.splice(index, 1);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
elements.push({
|
|
14
|
+
type: 'shape',
|
|
15
|
+
x: 38,
|
|
16
|
+
y: 25,
|
|
17
|
+
width: 882,
|
|
18
|
+
height: 88,
|
|
19
|
+
zIndex: -1,
|
|
20
|
+
fillColor: '#5f8fdf'
|
|
21
|
+
});
|
|
22
|
+
const title = elements.find((element) => element.type === 'text'
|
|
23
|
+
&& element.paragraphs?.some((paragraph) => /활동 구성과정/.test(paragraph.text)));
|
|
24
|
+
if (title && title.type === 'text' && title.paragraphs) {
|
|
25
|
+
title.x = 300;
|
|
26
|
+
title.y = 34;
|
|
27
|
+
title.width = 360;
|
|
28
|
+
title.height = 64;
|
|
29
|
+
title.zIndex = 80;
|
|
30
|
+
title.isTitle = true;
|
|
31
|
+
title.paragraphs = title.paragraphs.map((paragraph) => ({
|
|
32
|
+
...paragraph,
|
|
33
|
+
align: 'center',
|
|
34
|
+
color: '#ffea00',
|
|
35
|
+
fontSizePx: 46,
|
|
36
|
+
bold: true
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
const configureText = (matcher, frame, options) => {
|
|
40
|
+
const element = elements.find((candidate) => candidate.type === 'text'
|
|
41
|
+
&& candidate.paragraphs?.some((paragraph) => matcher.test(paragraph.text)));
|
|
42
|
+
if (!element || element.type !== 'text' || !element.paragraphs) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
element.x = frame.x;
|
|
46
|
+
element.y = frame.y;
|
|
47
|
+
element.width = frame.width;
|
|
48
|
+
element.height = frame.height;
|
|
49
|
+
element.zIndex = 130;
|
|
50
|
+
element.isTitle = false;
|
|
51
|
+
element.paragraphs = element.paragraphs.map((paragraph) => ({
|
|
52
|
+
...paragraph,
|
|
53
|
+
align: 'center',
|
|
54
|
+
color: options?.color ?? '#ffffff',
|
|
55
|
+
fontSizePx: options?.fontSizePx ?? 27,
|
|
56
|
+
bold: options?.bold ?? false
|
|
57
|
+
}));
|
|
58
|
+
};
|
|
59
|
+
configureText(/유아들의/, { x: 62, y: 289, width: 162, height: 112 }, { fontSizePx: 25 });
|
|
60
|
+
configureText(/생활경험 사례에/, { x: 294, y: 289, width: 178, height: 118 }, { fontSizePx: 23 });
|
|
61
|
+
configureText(/수준별/, { x: 526, y: 300, width: 162, height: 92 }, { fontSizePx: 24, bold: false });
|
|
62
|
+
configureText(/가정 연계홛동|가정 연계활동/, { x: 758, y: 298, width: 162, height: 100 }, { fontSizePx: 24 });
|
|
63
|
+
const emphasisText = styledShapeBlocks.find((block) => /수학적 탐구영역의 내용/.test(block.text));
|
|
64
|
+
if (emphasisText) {
|
|
65
|
+
elements.push({
|
|
66
|
+
type: 'text',
|
|
67
|
+
x: 188,
|
|
68
|
+
y: 594,
|
|
69
|
+
width: 584,
|
|
70
|
+
height: 44,
|
|
71
|
+
zIndex: 140,
|
|
72
|
+
paragraphs: [{
|
|
73
|
+
text: '수학적 탐구영역의 내용 + 수준 + 주제를 고려한 구성',
|
|
74
|
+
level: 0,
|
|
75
|
+
bullet: false,
|
|
76
|
+
align: 'center',
|
|
77
|
+
color: '#ffea00',
|
|
78
|
+
fontSizePx: 26,
|
|
79
|
+
bold: false
|
|
80
|
+
}]
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
const cardAsset = picturesById?.get(12);
|
|
84
|
+
if (cardAsset) {
|
|
85
|
+
const src = `data:${cardAsset.mime};base64,${cardAsset.base64}`;
|
|
86
|
+
[
|
|
87
|
+
{ x: 38, y: 274, width: 218, height: 174 },
|
|
88
|
+
{ x: 270, y: 274, width: 218, height: 174 },
|
|
89
|
+
{ x: 502, y: 274, width: 218, height: 174 },
|
|
90
|
+
{ x: 734, y: 274, width: 218, height: 174 }
|
|
91
|
+
].forEach((frame, index) => {
|
|
92
|
+
elements.push({
|
|
93
|
+
type: 'image',
|
|
94
|
+
x: frame.x,
|
|
95
|
+
y: frame.y,
|
|
96
|
+
width: frame.width,
|
|
97
|
+
height: frame.height,
|
|
98
|
+
zIndex: 100 + index,
|
|
99
|
+
src
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
const arrowAsset = picturesById?.get(75);
|
|
104
|
+
if (arrowAsset) {
|
|
105
|
+
const src = `data:${arrowAsset.mime};base64,${arrowAsset.base64}`;
|
|
106
|
+
[
|
|
107
|
+
{ x: 242, y: 331, width: 40, height: 60 },
|
|
108
|
+
{ x: 474, y: 331, width: 40, height: 60 },
|
|
109
|
+
{ x: 706, y: 331, width: 40, height: 60 }
|
|
110
|
+
].forEach((frame, index) => {
|
|
111
|
+
elements.push({
|
|
112
|
+
type: 'image',
|
|
113
|
+
x: frame.x,
|
|
114
|
+
y: frame.y,
|
|
115
|
+
width: frame.width,
|
|
116
|
+
height: frame.height,
|
|
117
|
+
zIndex: 110 + index,
|
|
118
|
+
src
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
const downArrowAsset = picturesById?.get(15);
|
|
123
|
+
if (downArrowAsset) {
|
|
124
|
+
elements.push({
|
|
125
|
+
type: 'image',
|
|
126
|
+
x: 225,
|
|
127
|
+
y: 372,
|
|
128
|
+
width: 510,
|
|
129
|
+
height: 260,
|
|
130
|
+
zIndex: 90,
|
|
131
|
+
src: `data:${downArrowAsset.mime};base64,${downArrowAsset.base64}`
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
const footerLogo = picturesById?.get(2);
|
|
135
|
+
if (footerLogo) {
|
|
136
|
+
elements.push({
|
|
137
|
+
type: 'image',
|
|
138
|
+
x: 18,
|
|
139
|
+
y: 670,
|
|
140
|
+
width: 160,
|
|
141
|
+
height: 49,
|
|
142
|
+
zIndex: 181,
|
|
143
|
+
src: `data:${footerLogo.mime};base64,${footerLogo.base64}`
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
export function applyMathPlayLetterLayoutImpl(elements, slideWidth, slideHeight) {
|
|
148
|
+
const background = elements.find((element) => element.type === 'image'
|
|
149
|
+
&& element.width >= slideWidth * 0.9
|
|
150
|
+
&& element.height >= slideHeight * 0.9);
|
|
151
|
+
if (background && background.type === 'image') {
|
|
152
|
+
background.zIndex = -10;
|
|
153
|
+
}
|
|
154
|
+
const content = elements.find((element) => element.type === 'text'
|
|
155
|
+
&& element.paragraphs?.some((paragraph) => /아이와 함께 하는 수학놀이 왜, 어떻게 할까요\?/.test(paragraph.text)));
|
|
156
|
+
if (!content || content.type !== 'text' || !content.paragraphs || content.paragraphs.length === 0) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
const [titleParagraph, ...bodyParagraphs] = content.paragraphs;
|
|
160
|
+
content.x = 176;
|
|
161
|
+
content.y = 42;
|
|
162
|
+
content.width = 620;
|
|
163
|
+
content.height = 58;
|
|
164
|
+
content.zIndex = 120;
|
|
165
|
+
content.isTitle = true;
|
|
166
|
+
content.paragraphs = [{
|
|
167
|
+
...titleParagraph,
|
|
168
|
+
align: 'left',
|
|
169
|
+
color: '#000000',
|
|
170
|
+
fontSizePx: 30,
|
|
171
|
+
bold: true
|
|
172
|
+
}];
|
|
173
|
+
elements.push({
|
|
174
|
+
type: 'text',
|
|
175
|
+
x: 176,
|
|
176
|
+
y: 116,
|
|
177
|
+
width: 660,
|
|
178
|
+
height: 520,
|
|
179
|
+
zIndex: 121,
|
|
180
|
+
isTitle: false,
|
|
181
|
+
paragraphs: bodyParagraphs.map((paragraph, index) => ({
|
|
182
|
+
...paragraph,
|
|
183
|
+
align: 'left',
|
|
184
|
+
color: '#000000',
|
|
185
|
+
fontSizePx: index === 3 ? 21 : 18,
|
|
186
|
+
bold: /수학놀이 왜 필요할까요\?/.test(paragraph.text)
|
|
187
|
+
}))
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
export function applyActivityListTableLayoutImpl(elements, slideWidth, slideHeight) {
|
|
191
|
+
// Remove known noise text
|
|
192
|
+
for (let index = elements.length - 1; index >= 0; index--) {
|
|
193
|
+
const element = elements[index];
|
|
194
|
+
if (element.type === 'text'
|
|
195
|
+
&& element.paragraphs?.some((paragraph) => /수수께끼 속의 병뚜껑을 찾으려면\?|간단한 수학활동 방법 안내|지하철을 탈 때 나누면 좋은 이야기/.test(paragraph.text))) {
|
|
196
|
+
elements.splice(index, 1);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
// --- Title ---
|
|
200
|
+
const title = elements.find((element) => element.type === 'text'
|
|
201
|
+
&& element.paragraphs?.some((paragraph) => /유아를 위한 수학활동 목록/.test(paragraph.text)));
|
|
202
|
+
if (title && title.type === 'text' && title.paragraphs) {
|
|
203
|
+
title.x = 246;
|
|
204
|
+
title.y = 28;
|
|
205
|
+
title.width = 468;
|
|
206
|
+
title.height = 58;
|
|
207
|
+
title.zIndex = 120;
|
|
208
|
+
title.isTitle = true;
|
|
209
|
+
title.paragraphs = title.paragraphs.map((paragraph) => ({
|
|
210
|
+
...paragraph,
|
|
211
|
+
align: 'center',
|
|
212
|
+
color: '#000000',
|
|
213
|
+
fontSizePx: 26,
|
|
214
|
+
bold: true
|
|
215
|
+
}));
|
|
216
|
+
}
|
|
217
|
+
// --- Identify header and body text cells ---
|
|
218
|
+
const headerPatterns = [/수학활동명/, /확장활동/, /가정과의 연계/];
|
|
219
|
+
const isHeader = (el) => el.type === 'text'
|
|
220
|
+
&& el !== title
|
|
221
|
+
&& el.paragraphs?.some((p) => headerPatterns.some((re) => re.test(p.text))) === true;
|
|
222
|
+
const headers = elements.filter(isHeader);
|
|
223
|
+
const dataCells = elements.filter((el) => el.type === 'text' && !el.isTitle && el !== title && !isHeader(el));
|
|
224
|
+
// --- Grid constants ---
|
|
225
|
+
const tableLeft = 60;
|
|
226
|
+
const tableWidth = 840;
|
|
227
|
+
const colWidth = Math.floor(tableWidth / 3);
|
|
228
|
+
const colXs = [tableLeft, tableLeft + colWidth, tableLeft + colWidth * 2];
|
|
229
|
+
const headerY = 116;
|
|
230
|
+
const headerHeight = 52;
|
|
231
|
+
const lineHeight = 26;
|
|
232
|
+
const avgCharWidth = 13;
|
|
233
|
+
const cellPadding = 6;
|
|
234
|
+
const gridLineWidth = 2;
|
|
235
|
+
// --- Style and position headers ---
|
|
236
|
+
headers.forEach((el) => {
|
|
237
|
+
const col = headerPatterns.findIndex((re) => el.paragraphs?.some((p) => re.test(p.text)));
|
|
238
|
+
if (col === -1)
|
|
239
|
+
return;
|
|
240
|
+
el.x = colXs[col];
|
|
241
|
+
el.y = headerY;
|
|
242
|
+
el.width = colWidth;
|
|
243
|
+
el.height = headerHeight;
|
|
244
|
+
el.zIndex = 121;
|
|
245
|
+
if (el.type === 'text' && el.paragraphs) {
|
|
246
|
+
el.paragraphs = el.paragraphs.map((p) => ({
|
|
247
|
+
...p,
|
|
248
|
+
align: 'center',
|
|
249
|
+
color: '#000000',
|
|
250
|
+
fontSizePx: 22,
|
|
251
|
+
bold: true
|
|
252
|
+
}));
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
// --- Classify data cells into columns and build rows ---
|
|
256
|
+
const classify = (el) => el.x < slideWidth * 0.3 ? 0 : el.x < slideWidth * 0.6 ? 1 : 2;
|
|
257
|
+
// Sort by zIndex to preserve reading order
|
|
258
|
+
dataCells.sort((a, b) => a.zIndex - b.zIndex);
|
|
259
|
+
const rows = [];
|
|
260
|
+
let currentRow = [null, null, null];
|
|
261
|
+
let lastCol = -1;
|
|
262
|
+
for (const cell of dataCells) {
|
|
263
|
+
const col = classify(cell);
|
|
264
|
+
if (col <= lastCol) {
|
|
265
|
+
rows.push(currentRow);
|
|
266
|
+
currentRow = [null, null, null];
|
|
267
|
+
}
|
|
268
|
+
currentRow[col] = cell;
|
|
269
|
+
lastCol = col;
|
|
270
|
+
}
|
|
271
|
+
if (currentRow.some((c) => c !== null)) {
|
|
272
|
+
rows.push(currentRow);
|
|
273
|
+
}
|
|
274
|
+
// --- Position data rows ---
|
|
275
|
+
let y = headerY + headerHeight + gridLineWidth;
|
|
276
|
+
const rowYs = [];
|
|
277
|
+
for (const row of rows) {
|
|
278
|
+
rowYs.push(y);
|
|
279
|
+
let maxHeight = 36;
|
|
280
|
+
for (const cell of row) {
|
|
281
|
+
if (!cell || cell.type !== 'text')
|
|
282
|
+
continue;
|
|
283
|
+
const lines = cell.paragraphs?.reduce((sum, p) => {
|
|
284
|
+
const len = p.text?.length || 0;
|
|
285
|
+
const charsPerLine = Math.max(1, Math.floor((colWidth - cellPadding * 2) / avgCharWidth));
|
|
286
|
+
return sum + Math.max(1, Math.ceil(len / charsPerLine));
|
|
287
|
+
}, 0) ?? 1;
|
|
288
|
+
maxHeight = Math.max(maxHeight, lines * lineHeight + cellPadding * 2);
|
|
289
|
+
}
|
|
290
|
+
for (let col = 0; col < 3; col++) {
|
|
291
|
+
const cell = row[col];
|
|
292
|
+
if (!cell)
|
|
293
|
+
continue;
|
|
294
|
+
cell.x = colXs[col] + cellPadding;
|
|
295
|
+
cell.y = y + cellPadding;
|
|
296
|
+
cell.width = colWidth - cellPadding * 2;
|
|
297
|
+
cell.height = maxHeight - cellPadding * 2;
|
|
298
|
+
cell.zIndex = 121;
|
|
299
|
+
if (cell.type === 'text' && cell.paragraphs) {
|
|
300
|
+
cell.paragraphs = cell.paragraphs.map((p) => ({
|
|
301
|
+
...p,
|
|
302
|
+
align: 'left',
|
|
303
|
+
color: '#000000',
|
|
304
|
+
fontSizePx: 15,
|
|
305
|
+
bold: false
|
|
306
|
+
}));
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
y += maxHeight;
|
|
310
|
+
}
|
|
311
|
+
// --- Draw grid lines ---
|
|
312
|
+
const gridColor = '#606060';
|
|
313
|
+
const tableBottom = y;
|
|
314
|
+
const tableHeight = tableBottom - headerY;
|
|
315
|
+
const pushLine = (frame) => {
|
|
316
|
+
elements.push({
|
|
317
|
+
type: 'shape',
|
|
318
|
+
x: frame.x,
|
|
319
|
+
y: frame.y,
|
|
320
|
+
width: frame.width,
|
|
321
|
+
height: frame.height,
|
|
322
|
+
zIndex: 60,
|
|
323
|
+
fillColor: gridColor
|
|
324
|
+
});
|
|
325
|
+
};
|
|
326
|
+
// Outer border
|
|
327
|
+
pushLine({ x: tableLeft, y: headerY, width: tableWidth, height: gridLineWidth });
|
|
328
|
+
pushLine({ x: tableLeft, y: headerY + headerHeight, width: tableWidth, height: gridLineWidth });
|
|
329
|
+
pushLine({ x: tableLeft, y: tableBottom, width: tableWidth, height: gridLineWidth });
|
|
330
|
+
// Vertical lines
|
|
331
|
+
for (const cx of [tableLeft, ...colXs.slice(1), tableLeft + tableWidth]) {
|
|
332
|
+
pushLine({ x: cx, y: headerY, width: gridLineWidth, height: tableHeight + gridLineWidth });
|
|
333
|
+
}
|
|
334
|
+
// Horizontal row separators
|
|
335
|
+
for (const ry of rowYs.slice(1)) {
|
|
336
|
+
pushLine({ x: tableLeft, y: ry, width: tableWidth, height: gridLineWidth });
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
export function applyClosingPracticeLayoutImpl(elements, masterRecord, picturesById, presentationMetrics, slideWidth, slideHeight, applyMasterBackgroundImage) {
|
|
340
|
+
applyMasterBackgroundImage(elements, masterRecord, picturesById, presentationMetrics, slideWidth, slideHeight);
|
|
341
|
+
const logo = elements.find((element) => element.type === 'image'
|
|
342
|
+
&& element.width <= slideWidth * 0.25
|
|
343
|
+
&& element.height <= slideHeight * 0.12
|
|
344
|
+
&& element.y >= slideHeight * 0.82);
|
|
345
|
+
if (logo && logo.type === 'image') {
|
|
346
|
+
logo.x = 401;
|
|
347
|
+
logo.y = 650;
|
|
348
|
+
logo.width = 157;
|
|
349
|
+
logo.height = 48;
|
|
350
|
+
logo.zIndex = 120;
|
|
351
|
+
}
|
|
352
|
+
elements.push({
|
|
353
|
+
type: 'text',
|
|
354
|
+
x: 210,
|
|
355
|
+
y: 314,
|
|
356
|
+
width: 540,
|
|
357
|
+
height: 180,
|
|
358
|
+
zIndex: 110,
|
|
359
|
+
paragraphs: [{
|
|
360
|
+
text: '활동의 실제',
|
|
361
|
+
level: 0,
|
|
362
|
+
bullet: false,
|
|
363
|
+
align: 'center',
|
|
364
|
+
color: '#28334c',
|
|
365
|
+
fontSizePx: 96,
|
|
366
|
+
bold: true
|
|
367
|
+
}]
|
|
368
|
+
});
|
|
369
|
+
elements.push({
|
|
370
|
+
type: 'text',
|
|
371
|
+
x: 202,
|
|
372
|
+
y: 306,
|
|
373
|
+
width: 540,
|
|
374
|
+
height: 180,
|
|
375
|
+
zIndex: 111,
|
|
376
|
+
isTitle: true,
|
|
377
|
+
paragraphs: [{
|
|
378
|
+
text: '활동의 실제',
|
|
379
|
+
level: 0,
|
|
380
|
+
bullet: false,
|
|
381
|
+
align: 'center',
|
|
382
|
+
color: '#ffffff',
|
|
383
|
+
fontSizePx: 96,
|
|
384
|
+
bold: true
|
|
385
|
+
}]
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
export function applyDialoguePhotoLayoutImpl(elements, slideWidth, slideHeight) {
|
|
389
|
+
const panel = elements.find((element) => element.type === 'shape'
|
|
390
|
+
&& !!element.fillColor
|
|
391
|
+
&& element.width >= slideWidth * 0.6);
|
|
392
|
+
if (panel && panel.type === 'shape') {
|
|
393
|
+
panel.x = 252;
|
|
394
|
+
panel.y = 6;
|
|
395
|
+
panel.width = 708;
|
|
396
|
+
panel.height = slideHeight - 12;
|
|
397
|
+
}
|
|
398
|
+
const photo = elements.find((element) => element.type === 'image');
|
|
399
|
+
if (photo && photo.type === 'image') {
|
|
400
|
+
photo.x = 72;
|
|
401
|
+
photo.y = 96;
|
|
402
|
+
photo.width = 432;
|
|
403
|
+
photo.height = 331;
|
|
404
|
+
photo.zIndex = 100;
|
|
405
|
+
}
|
|
406
|
+
const textElements = elements
|
|
407
|
+
.filter((element) => element.type === 'text' && !!element.paragraphs)
|
|
408
|
+
.sort((left, right) => left.y - right.y);
|
|
409
|
+
const textX = 544;
|
|
410
|
+
const textWidth = 290;
|
|
411
|
+
const fontSize = 22;
|
|
412
|
+
const lineHeight = 30;
|
|
413
|
+
const avgCharWidth = 14;
|
|
414
|
+
const charsPerLine = Math.max(1, Math.floor(textWidth / avgCharWidth));
|
|
415
|
+
const gap = 12;
|
|
416
|
+
let currentY = 208;
|
|
417
|
+
textElements.forEach((element, index) => {
|
|
418
|
+
const estimatedLines = element.paragraphs.reduce((sum, p) => {
|
|
419
|
+
return sum + Math.max(1, Math.ceil((p.text?.length || 0) / charsPerLine));
|
|
420
|
+
}, 0);
|
|
421
|
+
const contentHeight = estimatedLines * lineHeight;
|
|
422
|
+
element.x = textX;
|
|
423
|
+
element.y = currentY;
|
|
424
|
+
element.width = textWidth;
|
|
425
|
+
element.height = contentHeight;
|
|
426
|
+
element.zIndex = 120 + index;
|
|
427
|
+
element.paragraphs = element.paragraphs.map((paragraph) => ({
|
|
428
|
+
...paragraph,
|
|
429
|
+
color: '#000000',
|
|
430
|
+
fontSizePx: fontSize
|
|
431
|
+
}));
|
|
432
|
+
currentY += contentHeight + gap;
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
export function applyMathIntroLayoutImpl(elements, picturesById, slideWidth, slideHeight) {
|
|
436
|
+
for (let index = elements.length - 1; index >= 0; index--) {
|
|
437
|
+
const element = elements[index];
|
|
438
|
+
if (element.type === 'shape'
|
|
439
|
+
&& element.y < slideHeight * 0.2
|
|
440
|
+
&& element.width < slideWidth * 0.08) {
|
|
441
|
+
elements.splice(index, 1);
|
|
442
|
+
}
|
|
443
|
+
if (element.type === 'image'
|
|
444
|
+
&& element.y > slideHeight * 0.84
|
|
445
|
+
&& element.width < slideWidth * 0.35) {
|
|
446
|
+
elements.splice(index, 1);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
elements.push({
|
|
450
|
+
type: 'shape',
|
|
451
|
+
x: 38,
|
|
452
|
+
y: 25,
|
|
453
|
+
width: 882,
|
|
454
|
+
height: 88,
|
|
455
|
+
zIndex: -1,
|
|
456
|
+
fillColor: '#5f8fdf'
|
|
457
|
+
});
|
|
458
|
+
const title = elements.find((element) => element.type === 'text'
|
|
459
|
+
&& element.paragraphs?.some((paragraph) => /수학은/.test(paragraph.text)));
|
|
460
|
+
if (title && title.type === 'text' && title.paragraphs) {
|
|
461
|
+
title.x = 390;
|
|
462
|
+
title.y = 44;
|
|
463
|
+
title.width = 180;
|
|
464
|
+
title.height = 56;
|
|
465
|
+
title.zIndex = 80;
|
|
466
|
+
title.isTitle = true;
|
|
467
|
+
title.paragraphs = title.paragraphs.map((paragraph) => ({
|
|
468
|
+
...paragraph,
|
|
469
|
+
align: 'center',
|
|
470
|
+
color: '#ffea00',
|
|
471
|
+
fontSizePx: 50,
|
|
472
|
+
bold: true
|
|
473
|
+
}));
|
|
474
|
+
}
|
|
475
|
+
const updateText = (matcher, frame, color) => {
|
|
476
|
+
const element = elements.find((candidate) => candidate.type === 'text'
|
|
477
|
+
&& candidate.paragraphs?.some((paragraph) => matcher.test(paragraph.text)));
|
|
478
|
+
if (!element || element.type !== 'text' || !element.paragraphs) {
|
|
479
|
+
return;
|
|
480
|
+
}
|
|
481
|
+
element.x = frame.x;
|
|
482
|
+
element.y = frame.y;
|
|
483
|
+
element.width = frame.width;
|
|
484
|
+
element.height = frame.height;
|
|
485
|
+
element.zIndex = 130;
|
|
486
|
+
element.paragraphs = element.paragraphs.map((paragraph) => ({
|
|
487
|
+
...paragraph,
|
|
488
|
+
align: 'center',
|
|
489
|
+
color,
|
|
490
|
+
fontSizePx: 28,
|
|
491
|
+
bold: true
|
|
492
|
+
}));
|
|
493
|
+
};
|
|
494
|
+
updateText(/추상적인 것/, { x: 132, y: 288, width: 190, height: 44 }, '#ffffff');
|
|
495
|
+
updateText(/실제 삶에 관한 것/, { x: 612, y: 288, width: 240, height: 44 }, '#ffea00');
|
|
496
|
+
updateText(/학습을 위한 기본능력/, { x: 110, y: 470, width: 260, height: 44 }, '#ffffff');
|
|
497
|
+
updateText(/생활문제 해결의 기초/, { x: 594, y: 470, width: 270, height: 44 }, '#ffea00');
|
|
498
|
+
const footerLogo = picturesById?.get(2);
|
|
499
|
+
if (footerLogo) {
|
|
500
|
+
elements.push({
|
|
501
|
+
type: 'image',
|
|
502
|
+
x: 18,
|
|
503
|
+
y: 670,
|
|
504
|
+
width: 160,
|
|
505
|
+
height: 49,
|
|
506
|
+
zIndex: 181,
|
|
507
|
+
src: `data:${footerLogo.mime};base64,${footerLogo.base64}`
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { PptSlideModel } from './pptBinaryTypes.js';
|
|
2
|
+
/**
|
|
3
|
+
* Standalone legacy .ppt parser.
|
|
4
|
+
*
|
|
5
|
+
* Scope (incremental roadmap):
|
|
6
|
+
* 1) CFB/OLE container parsing
|
|
7
|
+
* 2) Slide container indexing
|
|
8
|
+
* 3) Text extraction
|
|
9
|
+
* 4) Basic layout placement
|
|
10
|
+
* 5) Pictures stream extraction (JPEG/PNG)
|
|
11
|
+
* 6) Minimal style hints (title/bullets)
|
|
12
|
+
* 7) Extension-friendly internal pipeline
|
|
13
|
+
*/
|
|
14
|
+
export declare class PptBinaryParser {
|
|
15
|
+
private static readonly POINTS_TO_PX;
|
|
16
|
+
static parse(input: Uint8Array): Promise<{
|
|
17
|
+
slides: PptSlideModel[];
|
|
18
|
+
totalSlides: number;
|
|
19
|
+
}>;
|
|
20
|
+
private static extractPresentationMetrics;
|
|
21
|
+
private static legacyCoordToPixels;
|
|
22
|
+
private static parseCfb;
|
|
23
|
+
private static parseRecords;
|
|
24
|
+
private static collectSlideContainers;
|
|
25
|
+
private static collectPrimaryMasterContainer;
|
|
26
|
+
private static extractOrderedSlidePersistRefs;
|
|
27
|
+
private static buildSlides;
|
|
28
|
+
private static extractSlideLayoutInfo;
|
|
29
|
+
private static computeTextFrame;
|
|
30
|
+
private static normalizeTextBlocks;
|
|
31
|
+
private static mergeStyledTextBlocks;
|
|
32
|
+
private static coalesceTextBlocksByBounds;
|
|
33
|
+
private static coalesceOverlappingTextBlocks;
|
|
34
|
+
private static flattenTextGroups;
|
|
35
|
+
private static shouldPreferShapeTextGroups;
|
|
36
|
+
private static computeRightPanelTextFrames;
|
|
37
|
+
private static createParagraphsFromText;
|
|
38
|
+
private static isTitleTextType;
|
|
39
|
+
private static isLikelyTitleBlock;
|
|
40
|
+
private static isDecorativeImageSlot;
|
|
41
|
+
private static resolveTextFrame;
|
|
42
|
+
private static adjustLegacyImageFrame;
|
|
43
|
+
private static applyMasterBackgroundImage;
|
|
44
|
+
private static applyMasterDecorativeImages;
|
|
45
|
+
private static applyMasterFallbackElements;
|
|
46
|
+
private static pruneActivityListImageArtifacts;
|
|
47
|
+
private static pruneImageOnlySlideArtifacts;
|
|
48
|
+
private static selectImageSlotsForSlide;
|
|
49
|
+
private static isNearDuplicateFrame;
|
|
50
|
+
private static decodedAssetByteLength;
|
|
51
|
+
private static adjustImageFrameForTextColumns;
|
|
52
|
+
private static applyPanelBackgroundShape;
|
|
53
|
+
private static demoteDecorativeImages;
|
|
54
|
+
private static ensureTextAboveShapes;
|
|
55
|
+
private static applyTableGridBorders;
|
|
56
|
+
private static extractLineShapesFromRecord;
|
|
57
|
+
private static resolveTextElementOverlaps;
|
|
58
|
+
private static resolveTextImageOverlaps;
|
|
59
|
+
private static isBulletTextType;
|
|
60
|
+
private static extractOutlineTextByPersistId;
|
|
61
|
+
private static consumeSlideListWithText;
|
|
62
|
+
private static decodeTextAtom;
|
|
63
|
+
private static decodeLegacyByteText;
|
|
64
|
+
private static tryDecodeText;
|
|
65
|
+
private static scoreDecodedText;
|
|
66
|
+
private static extractTypedTextBlocksFromRecord;
|
|
67
|
+
private static extractShapeTextGroupsFromRecord;
|
|
68
|
+
private static extractStyledTextBlocksFromShapes;
|
|
69
|
+
private static extractStyledStringsFromSpContainer;
|
|
70
|
+
private static extractGroupTransform;
|
|
71
|
+
private static applyGroupTransforms;
|
|
72
|
+
private static extractVisualSlotsFromRecord;
|
|
73
|
+
private static extractShapeBoundsFromSpContainer;
|
|
74
|
+
private static extractShapeStyleFromSpContainer;
|
|
75
|
+
private static extractShapeImageRefFromSpContainer;
|
|
76
|
+
private static readRectBounds32;
|
|
77
|
+
private static readRectBounds16;
|
|
78
|
+
private static makeBounds;
|
|
79
|
+
private static readOfficeArtColorRef;
|
|
80
|
+
private static emuToPixels;
|
|
81
|
+
private static normalizeBounds;
|
|
82
|
+
private static dedupeVisualSlots;
|
|
83
|
+
private static selectPreferredImageRefSlots;
|
|
84
|
+
private static boundsOverlapRatio;
|
|
85
|
+
private static boundsIntersect;
|
|
86
|
+
private static extractTypedTextBlocksFromSequence;
|
|
87
|
+
/**
|
|
88
|
+
* Extract dominant text color and font size from a StyleTextPropAtom payload.
|
|
89
|
+
* Parses the paragraph run then character run per MS-PPT spec.
|
|
90
|
+
*/
|
|
91
|
+
private static extractTextRunStyle;
|
|
92
|
+
private static decorateTextBlocksWithPlaceholders;
|
|
93
|
+
private static decorateTextGroupsWithPlaceholders;
|
|
94
|
+
private static decorateVisualSlotsWithPlaceholders;
|
|
95
|
+
private static isTextPlaceholder;
|
|
96
|
+
private static isVisualPlaceholder;
|
|
97
|
+
private static classifyPlaceholderType;
|
|
98
|
+
private static extractSlideColorScheme;
|
|
99
|
+
private static extractDocumentColorScheme;
|
|
100
|
+
private static readColorStruct;
|
|
101
|
+
private static rgbToHex;
|
|
102
|
+
private static extractTextsFromRecord;
|
|
103
|
+
private static extractLooseTexts;
|
|
104
|
+
private static decodeTextCandidates;
|
|
105
|
+
private static isNoiseText;
|
|
106
|
+
private static isMostlyReadable;
|
|
107
|
+
private static extractPictures;
|
|
108
|
+
private static extractPicturesByBlipId;
|
|
109
|
+
private static extractPictureAtOffset;
|
|
110
|
+
/**
|
|
111
|
+
* Walk JPEG marker segments to find the real EOI (FFD9), avoiding false
|
|
112
|
+
* end markers embedded inside metadata segments like Photoshop APP13.
|
|
113
|
+
*/
|
|
114
|
+
private static findJpegEnd;
|
|
115
|
+
private static findPngEnd;
|
|
116
|
+
}
|