layoutbridge-light 0.0.0-stage → 1.0.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.
- package/CHANGELOG.md +105 -0
- package/LICENSE +26 -0
- package/README.de.md +367 -0
- package/README.md +353 -2
- package/THIRD-PARTY-NOTICES.md +2878 -0
- package/dist/src/mcp/catalog.js +131 -0
- package/dist/src/mcp/config.js +211 -0
- package/dist/src/mcp/content-credentials.js +65 -0
- package/dist/src/mcp/dispatch.js +171 -0
- package/dist/src/mcp/epub-check.js +331 -0
- package/dist/src/mcp/epub-orientation.js +132 -0
- package/dist/src/mcp/license/free-tools.js +16 -0
- package/dist/src/mcp/license/gate.js +210 -0
- package/dist/src/mcp/license/index.js +107 -0
- package/dist/src/mcp/license/instance-name.js +57 -0
- package/dist/src/mcp/license/key-source.js +59 -0
- package/dist/src/mcp/license/lemonsqueezy-verifier.js +207 -0
- package/dist/src/mcp/license/placeholder-verifier.js +10 -0
- package/dist/src/mcp/license/polar-ids.js +100 -0
- package/dist/src/mcp/license/polar-verifier.js +285 -0
- package/dist/src/mcp/license/product-ids.js +73 -0
- package/dist/src/mcp/license/state-store.js +91 -0
- package/dist/src/mcp/license/types.js +11 -0
- package/dist/src/mcp/logging.js +271 -0
- package/dist/src/mcp/pdf-postprocess.js +798 -0
- package/dist/src/mcp/product-info.js +54 -0
- package/dist/src/mcp/product.js +56 -0
- package/dist/src/mcp/server.js +253 -0
- package/dist/src/mcp/setup.js +680 -0
- package/dist/src/mcp/start.cjs +117 -0
- package/dist/src/mcp/target-folder.js +25 -0
- package/dist/src/mcp/tool-definition.js +2 -0
- package/dist/src/mcp/tools.js +2680 -0
- package/dist/src/mcp/typography-rules.js +70 -0
- package/dist/src/transport/com.js +436 -0
- package/dist/src/transport/osascript.js +171 -0
- package/dist/src/transport/queue.js +19 -0
- package/dist/src/transport/script-bundle.js +92 -0
- package/dist/src/transport/transport.js +52 -0
- package/indesign/commands/10-app.js +6 -0
- package/indesign/commands/20-documents.js +517 -0
- package/indesign/commands/22-document-setup.js +204 -0
- package/indesign/commands/23-save-package.js +258 -0
- package/indesign/commands/25-export.js +695 -0
- package/indesign/commands/26-export-image.js +202 -0
- package/indesign/commands/27-textdefaults.js +151 -0
- package/indesign/commands/28-selection.js +174 -0
- package/indesign/commands/30-pages.js +1032 -0
- package/indesign/commands/31-view.js +310 -0
- package/indesign/commands/32-sections.js +203 -0
- package/indesign/commands/35-parents.js +448 -0
- package/indesign/commands/37-layout.js +837 -0
- package/indesign/commands/40-frames.js +886 -0
- package/indesign/commands/41-shapes.js +505 -0
- package/indesign/commands/42-groups.js +117 -0
- package/indesign/commands/43-layers.js +310 -0
- package/indesign/commands/44-effects.js +274 -0
- package/indesign/commands/45-frame-options.js +247 -0
- package/indesign/commands/47-anchored.js +473 -0
- package/indesign/commands/50-modify.js +803 -0
- package/indesign/commands/52-align.js +139 -0
- package/indesign/commands/55-fit.js +106 -0
- package/indesign/commands/60-images.js +1154 -0
- package/indesign/commands/62-embed.js +120 -0
- package/indesign/commands/69-placeholders.js +132 -0
- package/indesign/commands/70-text.js +710 -0
- package/indesign/commands/71-outlines.js +92 -0
- package/indesign/commands/72-place-text.js +476 -0
- package/indesign/commands/73-story-lock.js +157 -0
- package/indesign/commands/74-stories.js +121 -0
- package/indesign/commands/75-tables.js +702 -0
- package/indesign/commands/76-text-variables.js +260 -0
- package/indesign/commands/77-story-options.js +86 -0
- package/indesign/commands/78-frame-lines.js +511 -0
- package/indesign/commands/79-check-typography.js +480 -0
- package/indesign/commands/80-styles.js +1960 -0
- package/indesign/commands/81-composition.js +355 -0
- package/indesign/commands/82-object-styles.js +263 -0
- package/indesign/commands/83-drop-caps.js +87 -0
- package/indesign/commands/83-indents-tabs.js +264 -0
- package/indesign/commands/84-import-styles.js +142 -0
- package/indesign/commands/85-swatches.js +112 -0
- package/indesign/commands/86-gradients.js +185 -0
- package/indesign/commands/87-replace-swatch.js +180 -0
- package/indesign/commands/88-replace-font.js +212 -0
- package/indesign/commands/89-toc-index.js +1002 -0
- package/indesign/commands/90-print-on-demand.js +495 -0
- package/indesign/commands/91-epub.js +629 -0
- package/indesign/commands/92-accessibility.js +1131 -0
- package/indesign/interpreter.js +829 -0
- package/package.json +41 -4
- package/rules/typography-rules.json +32 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* A-67 Punkt 1 (Sitzung 72) – Initialen fuer Absatzformate
|
|
3
|
+
* (define_paragraph_style) und Absaetze (set_paragraph_options), gelesen von
|
|
4
|
+
* list_paragraph_styles und den Rueckgaben.
|
|
5
|
+
*
|
|
6
|
+
* Adobe-DOM (Klasse Text/ParagraphStyle), live am 28.10.2026 an InDesign 21.6
|
|
7
|
+
* geprueft: dropCapLines (0–25, 0 = keine Initiale), dropCapCharacters
|
|
8
|
+
* (0–150), dropCapStyle (CharacterStyle, nimmt auch den Namen; ohne Format
|
|
9
|
+
* das eingebaute [Ohne]). Ein oeffnendes Anfuehrungszeichen am
|
|
10
|
+
* Absatzanfang ist ein eigenes Zeichen: mit characters 1 wird nur „ zur
|
|
11
|
+
* Initiale, mit 2 „ und der erste Buchstabe gemeinsam.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
var IDC_DROP_CAP_MAX_LINES = 25;
|
|
15
|
+
var IDC_DROP_CAP_MAX_CHARACTERS = 150;
|
|
16
|
+
|
|
17
|
+
/* drop_cap pruefen (vor jeder Aenderung); liefert { lines, characters, style, style_given } mit null fuer nicht Angegebenes. */
|
|
18
|
+
function idcDropCapArg(doc, value) {
|
|
19
|
+
var out = { lines: null, characters: null, style: null, style_given: false };
|
|
20
|
+
var name;
|
|
21
|
+
if (value === null || typeof value !== 'object' || IDC.isArray(value)) {
|
|
22
|
+
IDC.fail('invalid_argument', 'drop_cap must be an object {lines, characters, character_style}.', null);
|
|
23
|
+
}
|
|
24
|
+
if (idcGiven(value.lines)) {
|
|
25
|
+
out.lines = idcCountArg(value.lines, 'drop_cap.lines', 0, IDC_DROP_CAP_MAX_LINES, 0);
|
|
26
|
+
}
|
|
27
|
+
if (idcGiven(value.characters)) {
|
|
28
|
+
out.characters = idcCountArg(value.characters, 'drop_cap.characters', 0, IDC_DROP_CAP_MAX_CHARACTERS, 0);
|
|
29
|
+
}
|
|
30
|
+
if (idcGiven(value.character_style)) {
|
|
31
|
+
name = value.character_style;
|
|
32
|
+
if (typeof name !== 'string') {
|
|
33
|
+
IDC.fail('invalid_argument', 'drop_cap.character_style must be the name of an existing character style ("" or "[None]" for none).', { value: name });
|
|
34
|
+
}
|
|
35
|
+
out.style_given = true;
|
|
36
|
+
if (name === '' || name === '[None]') {
|
|
37
|
+
out.style = idcNoneCharacterStyle(doc);
|
|
38
|
+
} else {
|
|
39
|
+
out.style = idcCharacterStyleByName(doc, name);
|
|
40
|
+
if (out.style === null) {
|
|
41
|
+
IDC.fail('not_found', 'Character style "' + name + '" (drop_cap.character_style) does not exist; create it with define_character_style first.', { style_name: name });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (out.lines === null && out.characters === null && !out.style_given) {
|
|
46
|
+
IDC.fail('invalid_argument', 'drop_cap needs at least one of lines (0 = off), characters or character_style.', null);
|
|
47
|
+
}
|
|
48
|
+
return out;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/*
|
|
52
|
+
* Initiale an ein Format oder einen Absatz setzen. Mit lines > 0 und ohne
|
|
53
|
+
* characters bekommt ein Ziel ohne Initialzeichen eines (InDesign zeigte mit
|
|
54
|
+
* 0 Zeichen keine Initiale). Liefert ['drop_cap'] oder [].
|
|
55
|
+
*/
|
|
56
|
+
function idcApplyDropCap(target, spec) {
|
|
57
|
+
var current = 0;
|
|
58
|
+
if (spec === null) { return []; }
|
|
59
|
+
if (spec.lines !== null) {
|
|
60
|
+
target.dropCapLines = spec.lines;
|
|
61
|
+
if (spec.lines > 0 && spec.characters === null) {
|
|
62
|
+
try { current = Number(target.dropCapCharacters); } catch (e0) { current = 0; }
|
|
63
|
+
if (!(current > 0)) { target.dropCapCharacters = 1; }
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (spec.characters !== null) { target.dropCapCharacters = spec.characters; }
|
|
67
|
+
if (spec.style_given && spec.style !== null) { target.dropCapStyle = spec.style; }
|
|
68
|
+
return ['drop_cap'];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/*
|
|
72
|
+
* drop_cap {lines, characters, character_style} wie InDesign es fuehrt;
|
|
73
|
+
* character_style null fuer [Ohne] (lokalisierter Name, das einzige
|
|
74
|
+
* Zeichenformat mit "[" am Anfang).
|
|
75
|
+
*/
|
|
76
|
+
function idcReadDropCap(target) {
|
|
77
|
+
var out = { lines: null, characters: null, character_style: null };
|
|
78
|
+
var style = null, name = '';
|
|
79
|
+
out.lines = idcReadNumberLoose(target, 'dropCapLines', 0);
|
|
80
|
+
out.characters = idcReadNumberLoose(target, 'dropCapCharacters', 0);
|
|
81
|
+
try { style = target.dropCapStyle; } catch (e2) { style = null; }
|
|
82
|
+
if (idcPresent(style)) {
|
|
83
|
+
try { name = String(style.name); } catch (e3) { name = ''; }
|
|
84
|
+
if (name !== '' && name.charAt(0) !== '[') { out.character_style = name; }
|
|
85
|
+
}
|
|
86
|
+
return out;
|
|
87
|
+
}
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Sitzung 10 (Demo-Heft-Befund 3, 05.09.2026) – Einzuege, Tabulatoren und
|
|
3
|
+
* Sprache fuer Absatzformate (define_paragraph_style) und Absaetze
|
|
4
|
+
* (set_paragraph_options).
|
|
5
|
+
*
|
|
6
|
+
* Adobe-DOM (geprueft 05.09.2026, Klasse Text): leftIndent, rightIndent,
|
|
7
|
+
* firstLineIndent, lastLineIndent (Masseinheit – hier mm, weil der
|
|
8
|
+
* Interpreter waehrend eines Befehls auf Millimeter steht); tabStops
|
|
9
|
+
* (Sammlung, add(withProperties)) mit TabStop.position, alignment
|
|
10
|
+
* (TabStopAlignment LEFT_ALIGN, CENTER_ALIGN, RIGHT_ALIGN, CHARACTER_ALIGN),
|
|
11
|
+
* leader, alignmentCharacter; appliedLanguage (Language oder
|
|
12
|
+
* LanguageWithVendors, nimmt auch String) – Language.name (lokalisiert),
|
|
13
|
+
* untranslatedName, icuLocaleName; Application.languagesWithVendors,
|
|
14
|
+
* Document.languages.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
var IDC_INDENT_MAX_MM = 3048; /* 8640 pt, InDesigns Grenze */
|
|
18
|
+
|
|
19
|
+
function idcIndentArg(value, field, min, max) {
|
|
20
|
+
if (typeof value !== 'number' || isNaN(value) || value < min || value > max) {
|
|
21
|
+
IDC.fail('invalid_argument', field + ' must be a number from ' + min + ' to ' + max + ' (mm).', { value: value });
|
|
22
|
+
}
|
|
23
|
+
return value;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* ---------------------------------------------------------- Tabulatoren */
|
|
27
|
+
|
|
28
|
+
function idcTabAlignmentFor(name, field) {
|
|
29
|
+
var text = name === undefined || name === null ? 'left' : String(name);
|
|
30
|
+
if (typeof TabStopAlignment === 'undefined') {
|
|
31
|
+
IDC.fail('invalid_state', 'This runtime has no TabStopAlignment enumeration.', null);
|
|
32
|
+
}
|
|
33
|
+
if (text === 'left') { return TabStopAlignment.LEFT_ALIGN; }
|
|
34
|
+
if (text === 'center') { return TabStopAlignment.CENTER_ALIGN; }
|
|
35
|
+
if (text === 'right') { return TabStopAlignment.RIGHT_ALIGN; }
|
|
36
|
+
if (text === 'character') { return TabStopAlignment.CHARACTER_ALIGN; }
|
|
37
|
+
IDC.fail('invalid_argument', field + ' must be left, center, right or character.', { value: name });
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function idcTabAlignmentName(value) {
|
|
42
|
+
if (typeof TabStopAlignment === 'undefined') { return String(value); }
|
|
43
|
+
if (IDC.enumIs(value, TabStopAlignment.LEFT_ALIGN)) { return 'left'; }
|
|
44
|
+
if (IDC.enumIs(value, TabStopAlignment.CENTER_ALIGN)) { return 'center'; }
|
|
45
|
+
if (IDC.enumIs(value, TabStopAlignment.RIGHT_ALIGN)) { return 'right'; }
|
|
46
|
+
if (IDC.enumIs(value, TabStopAlignment.CHARACTER_ALIGN)) { return 'character'; }
|
|
47
|
+
return String(value);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* tab_stops[] pruefen und in DOM-Eigenschaften uebersetzen (vor jeder Aenderung). */
|
|
51
|
+
function idcTabStopsArg(list) {
|
|
52
|
+
var out = [];
|
|
53
|
+
var i, spec, entry, leader, alignOn;
|
|
54
|
+
if (!IDC.isArray(list)) {
|
|
55
|
+
IDC.fail('invalid_argument', 'tab_stops must be an array of {position_mm, alignment, leader, align_on}; [] removes every tab stop.', null);
|
|
56
|
+
}
|
|
57
|
+
for (i = 0; i < list.length; i++) {
|
|
58
|
+
spec = list[i];
|
|
59
|
+
if (spec === null || typeof spec !== 'object' || IDC.isArray(spec)) {
|
|
60
|
+
IDC.fail('invalid_argument', 'tab_stops[' + i + '] must be an object {position_mm, alignment, leader, align_on}.', { index: i });
|
|
61
|
+
}
|
|
62
|
+
entry = { position: idcIndentArg(spec.position_mm, 'tab_stops[' + i + '].position_mm', 0, IDC_INDENT_MAX_MM) };
|
|
63
|
+
entry.alignment = idcTabAlignmentFor(spec.alignment, 'tab_stops[' + i + '].alignment');
|
|
64
|
+
leader = spec.leader === undefined || spec.leader === null ? '' : spec.leader;
|
|
65
|
+
if (typeof leader !== 'string' || leader.length > 8) {
|
|
66
|
+
IDC.fail('invalid_argument', 'tab_stops[' + i + '].leader must be a string of up to 8 characters (e.g. ".").', { index: i, value: spec.leader });
|
|
67
|
+
}
|
|
68
|
+
entry.leader = leader;
|
|
69
|
+
alignOn = spec.align_on === undefined || spec.align_on === null ? null : spec.align_on;
|
|
70
|
+
if (alignOn !== null && (typeof alignOn !== 'string' || alignOn.length !== 1)) {
|
|
71
|
+
IDC.fail('invalid_argument', 'tab_stops[' + i + '].align_on must be a single character (used with alignment character).', { index: i, value: spec.align_on });
|
|
72
|
+
}
|
|
73
|
+
entry.alignmentCharacter = alignOn;
|
|
74
|
+
out.push(entry);
|
|
75
|
+
}
|
|
76
|
+
return out;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* Alle Tabulatoren eines Ziels entfernen und die Liste neu setzen. */
|
|
80
|
+
function idcSetTabStops(target, entries) {
|
|
81
|
+
var stops, i, stop, props;
|
|
82
|
+
stops = target.tabStops;
|
|
83
|
+
for (i = stops.length - 1; i >= 0; i--) {
|
|
84
|
+
stops.item(i).remove();
|
|
85
|
+
}
|
|
86
|
+
for (i = 0; i < entries.length; i++) {
|
|
87
|
+
props = { position: entries[i].position, alignment: entries[i].alignment, leader: entries[i].leader };
|
|
88
|
+
if (entries[i].alignmentCharacter !== null) { props.alignmentCharacter = entries[i].alignmentCharacter; }
|
|
89
|
+
/*
|
|
90
|
+
* Nur add(withProperties): ein Nachsetzen der Eigenschaften am
|
|
91
|
+
* zurueckgegebenen TabStop loeschte am lebenden InDesign 21.5 die zuvor
|
|
92
|
+
* angelegten Tabulatoren (Live-Fund 05.09.2026 – von drei blieb einer).
|
|
93
|
+
*/
|
|
94
|
+
stop = target.tabStops.add(props);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function idcReadTabStops(target) {
|
|
99
|
+
var out = [];
|
|
100
|
+
var stops, i, stop, entry;
|
|
101
|
+
try { stops = target.tabStops; } catch (e0) { return null; }
|
|
102
|
+
try {
|
|
103
|
+
for (i = 0; i < stops.length; i++) {
|
|
104
|
+
stop = stops.item(i);
|
|
105
|
+
entry = { position_mm: null, alignment: null, leader: null, align_on: null };
|
|
106
|
+
try { entry.position_mm = IDC.round(Number(stop.position)); } catch (e1) { /* bleibt null */ }
|
|
107
|
+
try { entry.alignment = idcTabAlignmentName(stop.alignment); } catch (e2) { /* bleibt null */ }
|
|
108
|
+
try { entry.leader = String(stop.leader); } catch (e3) { /* bleibt null */ }
|
|
109
|
+
if (entry.alignment === 'character') {
|
|
110
|
+
try { entry.align_on = String(stop.alignmentCharacter); } catch (e4) { /* bleibt null */ }
|
|
111
|
+
}
|
|
112
|
+
out.push(entry);
|
|
113
|
+
}
|
|
114
|
+
} catch (e5) { return null; }
|
|
115
|
+
return out;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* -------------------------------------------------------------- Sprache */
|
|
119
|
+
|
|
120
|
+
function idcLanguageEntry(lang) {
|
|
121
|
+
var entry = { name: null, untranslated_name: null, icu_locale: null };
|
|
122
|
+
try { entry.name = String(lang.name); } catch (e0) { /* bleibt null */ }
|
|
123
|
+
try { entry.untranslated_name = String(lang.untranslatedName); } catch (e1) { /* bleibt null */ }
|
|
124
|
+
try { entry.icu_locale = String(lang.icuLocaleName); } catch (e2) { /* bleibt null */ }
|
|
125
|
+
return entry;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function idcLanguageKey(text) {
|
|
129
|
+
return String(text).toLowerCase().replace(/-/g, '_');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* Alle Sprachen: erst die der Anwendung (mit Anbietern), dann die des Dokuments. */
|
|
133
|
+
function idcAllLanguages(doc) {
|
|
134
|
+
var out = [];
|
|
135
|
+
var seen = {};
|
|
136
|
+
var lists = [], i, j, list, lang, key;
|
|
137
|
+
try { if (app.languagesWithVendors) { lists.push(app.languagesWithVendors); } } catch (e0) { /* keine */ }
|
|
138
|
+
try { if (doc.languages) { lists.push(doc.languages); } } catch (e1) { /* keine */ }
|
|
139
|
+
for (i = 0; i < lists.length; i++) {
|
|
140
|
+
list = lists[i];
|
|
141
|
+
try {
|
|
142
|
+
for (j = 0; j < list.length; j++) {
|
|
143
|
+
lang = list.item(j);
|
|
144
|
+
try { key = String(lang.name); } catch (e2) { continue; }
|
|
145
|
+
if (IDC.hasOwn(seen, key)) { continue; }
|
|
146
|
+
seen[key] = true;
|
|
147
|
+
out.push(lang);
|
|
148
|
+
}
|
|
149
|
+
} catch (e3) { /* naechste Liste */ }
|
|
150
|
+
}
|
|
151
|
+
return out;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/*
|
|
155
|
+
* Sprache ueber Namen (lokalisiert), englischen Namen oder ICU-Kennung (de_DE, de-DE) finden.
|
|
156
|
+
*
|
|
157
|
+
* Eine ICU-Kennung kann mehrere Sprachen meinen: de_DE steht in InDesign 21.6
|
|
158
|
+
* fuer "Deutsch: 1996 Rechtschreibreform", "Deutsch: 2006
|
|
159
|
+
* Rechtschreibreform" und "Deutsch: Alte Rechtschreibung" (Live-Probe
|
|
160
|
+
* 09.10.2026, A-43 Nebenbefund). Bis 1.0.1 gewann die erste der Liste (1996),
|
|
161
|
+
* neue Absatzformate bekommen aber 2006. Name und unuebersetzter Name gehen
|
|
162
|
+
* weiter sofort vor; unter mehreren ICU-Treffern gewinnt die 2006er-Fassung,
|
|
163
|
+
* sonst der erste, und eine Warnung nennt die Auswahl (ctx darf fehlen).
|
|
164
|
+
*/
|
|
165
|
+
function idcLanguageArg(doc, value, field, ctx) {
|
|
166
|
+
var wanted, all, i, lang, entry, available = [], icuHits = [], chosen, names;
|
|
167
|
+
if (typeof value !== 'string' || value === '') {
|
|
168
|
+
IDC.fail('invalid_argument', field + ' must be a language name as InDesign shows it, its English name, or an ICU locale such as de_DE.', { value: value });
|
|
169
|
+
}
|
|
170
|
+
wanted = idcLanguageKey(value);
|
|
171
|
+
all = idcAllLanguages(doc);
|
|
172
|
+
for (i = 0; i < all.length; i++) {
|
|
173
|
+
lang = all[i];
|
|
174
|
+
entry = idcLanguageEntry(lang);
|
|
175
|
+
if ((entry.name !== null && idcLanguageKey(entry.name) === wanted) ||
|
|
176
|
+
(entry.untranslated_name !== null && idcLanguageKey(entry.untranslated_name) === wanted)) {
|
|
177
|
+
return lang;
|
|
178
|
+
}
|
|
179
|
+
if (entry.icu_locale !== null && entry.icu_locale !== '' && idcLanguageKey(entry.icu_locale) === wanted) {
|
|
180
|
+
icuHits.push({ lang: lang, entry: entry });
|
|
181
|
+
}
|
|
182
|
+
if (available.length < 120) { available.push(entry); }
|
|
183
|
+
}
|
|
184
|
+
if (icuHits.length > 0) {
|
|
185
|
+
chosen = icuHits[0];
|
|
186
|
+
for (i = 0; i < icuHits.length; i++) {
|
|
187
|
+
if (String(icuHits[i].entry.untranslated_name).indexOf('2006') >= 0 || String(icuHits[i].entry.name).indexOf('2006') >= 0) {
|
|
188
|
+
chosen = icuHits[i];
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
if (icuHits.length > 1 && ctx) {
|
|
193
|
+
names = [];
|
|
194
|
+
for (i = 0; i < icuHits.length; i++) { names.push('"' + icuHits[i].entry.name + '"'); }
|
|
195
|
+
ctx.warn(field + ' "' + value + '" matches ' + icuHits.length + ' languages (' + names.join(', ') + '); used "' + chosen.entry.name + '". Pass the name to choose another.');
|
|
196
|
+
}
|
|
197
|
+
return chosen.lang;
|
|
198
|
+
}
|
|
199
|
+
IDC.fail('not_found', 'No language "' + value + '" in this InDesign. Use a name from available (name as shown, English name or ICU locale).',
|
|
200
|
+
{ language: value, available: available });
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function idcReadLanguage(target) {
|
|
205
|
+
var lang = null;
|
|
206
|
+
try { lang = target.appliedLanguage; } catch (e0) { return null; }
|
|
207
|
+
if (lang === null || lang === undefined) { return null; }
|
|
208
|
+
if (typeof lang === 'string') { return { name: lang, untranslated_name: null, icu_locale: null }; }
|
|
209
|
+
return idcLanguageEntry(lang);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/* ------------------------------------------------ gemeinsame Anwendung */
|
|
213
|
+
|
|
214
|
+
function idcIndentTabLanguageGiven(args) {
|
|
215
|
+
return idcGiven(args.left_indent_mm) || idcGiven(args.first_line_indent_mm) || idcGiven(args.right_indent_mm) ||
|
|
216
|
+
idcGiven(args.last_line_indent_mm) || idcGiven(args.tab_stops) || idcGiven(args.language);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/*
|
|
220
|
+
* Einzuege, Tabulatoren und Sprache an ein Format oder einen Absatz setzen.
|
|
221
|
+
* Erst pruefen (alle Argumente), dann schreiben. Liefert die Liste der
|
|
222
|
+
* gesetzten Felder.
|
|
223
|
+
*/
|
|
224
|
+
function idcApplyIndentTabLanguage(doc, target, args, ctx) {
|
|
225
|
+
var applied = [];
|
|
226
|
+
var left = null, first = null, right = null, last = null, tabs = null, lang = null;
|
|
227
|
+
var currentLeft = 0;
|
|
228
|
+
|
|
229
|
+
if (idcGiven(args.left_indent_mm)) { left = idcIndentArg(args.left_indent_mm, 'left_indent_mm', 0, IDC_INDENT_MAX_MM); }
|
|
230
|
+
if (idcGiven(args.right_indent_mm)) { right = idcIndentArg(args.right_indent_mm, 'right_indent_mm', 0, IDC_INDENT_MAX_MM); }
|
|
231
|
+
if (idcGiven(args.first_line_indent_mm)) { first = idcIndentArg(args.first_line_indent_mm, 'first_line_indent_mm', -IDC_INDENT_MAX_MM, IDC_INDENT_MAX_MM); }
|
|
232
|
+
if (idcGiven(args.last_line_indent_mm)) { last = idcIndentArg(args.last_line_indent_mm, 'last_line_indent_mm', -IDC_INDENT_MAX_MM, IDC_INDENT_MAX_MM); }
|
|
233
|
+
if (idcGiven(args.tab_stops)) { tabs = idcTabStopsArg(args.tab_stops); }
|
|
234
|
+
if (idcGiven(args.language)) { lang = idcLanguageArg(doc, args.language, 'language', ctx); }
|
|
235
|
+
|
|
236
|
+
/* Ein haengender Einzug darf nicht weiter nach links als der linke Einzug reichen (InDesign lehnt das ab). */
|
|
237
|
+
if (first !== null) {
|
|
238
|
+
try { currentLeft = Number(target.leftIndent); } catch (e0) { currentLeft = 0; }
|
|
239
|
+
if (left !== null) { currentLeft = left; }
|
|
240
|
+
if (first < 0 && -first > currentLeft + 0.0001) {
|
|
241
|
+
IDC.fail('invalid_argument', 'first_line_indent_mm ' + first + ' reaches further left than the left indent (' + IDC.round(currentLeft) + ' mm); a hanging indent needs left_indent_mm >= -first_line_indent_mm.',
|
|
242
|
+
{ first_line_indent_mm: first, left_indent_mm: currentLeft });
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
if (left !== null) { target.leftIndent = left; applied.push('left_indent_mm'); }
|
|
247
|
+
if (right !== null) { target.rightIndent = right; applied.push('right_indent_mm'); }
|
|
248
|
+
if (first !== null) { target.firstLineIndent = first; applied.push('first_line_indent_mm'); }
|
|
249
|
+
if (last !== null) { target.lastLineIndent = last; applied.push('last_line_indent_mm'); }
|
|
250
|
+
if (tabs !== null) { idcSetTabStops(target, tabs); applied.push('tab_stops'); }
|
|
251
|
+
if (lang !== null) { target.appliedLanguage = lang; applied.push('language'); }
|
|
252
|
+
return applied;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function idcReadIndentTabLanguage(target) {
|
|
256
|
+
return {
|
|
257
|
+
left_indent_mm: idcReadNumberLoose(target, 'leftIndent', 4),
|
|
258
|
+
first_line_indent_mm: idcReadNumberLoose(target, 'firstLineIndent', 4),
|
|
259
|
+
right_indent_mm: idcReadNumberLoose(target, 'rightIndent', 4),
|
|
260
|
+
last_line_indent_mm: idcReadNumberLoose(target, 'lastLineIndent', 4),
|
|
261
|
+
tab_stops: idcReadTabStops(target),
|
|
262
|
+
language: idcReadLanguage(target)
|
|
263
|
+
};
|
|
264
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/* Wunschliste J2 Nr. 19 (Sitzung 8) – Formate aus einer Vorlage uebernehmen: import_styles. */
|
|
2
|
+
|
|
3
|
+
var IDC_IMPORT_KINDS = ['paragraph', 'character', 'object', 'table', 'cell', 'swatches'];
|
|
4
|
+
|
|
5
|
+
function idcImportFormatFor(kind) {
|
|
6
|
+
if (typeof ImportFormat === 'undefined') { return null; }
|
|
7
|
+
if (kind === 'paragraph') { return ImportFormat.PARAGRAPH_STYLES_FORMAT; }
|
|
8
|
+
if (kind === 'character') { return ImportFormat.CHARACTER_STYLES_FORMAT; }
|
|
9
|
+
if (kind === 'object') { return ImportFormat.OBJECT_STYLES_FORMAT; }
|
|
10
|
+
if (kind === 'table') { return ImportFormat.TABLE_STYLES_FORMAT; }
|
|
11
|
+
if (kind === 'cell') { return ImportFormat.CELL_STYLES_FORMAT; }
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function idcClashStrategyFor(name) {
|
|
16
|
+
if (typeof GlobalClashResolutionStrategy === 'undefined') { return null; }
|
|
17
|
+
if (name === 'keep_existing') { return GlobalClashResolutionStrategy.DO_NOT_LOAD_THE_STYLE; }
|
|
18
|
+
if (name === 'overwrite') { return GlobalClashResolutionStrategy.LOAD_ALL_WITH_OVERWRITE; }
|
|
19
|
+
if (name === 'rename') { return GlobalClashResolutionStrategy.LOAD_ALL_WITH_RENAME; }
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* Namen einer Formatart im Dokument (Gruppen eingeschlossen). */
|
|
24
|
+
function idcStyleNamesOfKind(doc, kind) {
|
|
25
|
+
var list = [], i, all = null, collection = null;
|
|
26
|
+
try {
|
|
27
|
+
if (kind === 'paragraph') { all = doc.allParagraphStyles; }
|
|
28
|
+
else if (kind === 'character') { all = doc.allCharacterStyles; }
|
|
29
|
+
else if (kind === 'object') { all = doc.allObjectStyles; }
|
|
30
|
+
else if (kind === 'table') { all = doc.allTableStyles; }
|
|
31
|
+
else if (kind === 'cell') { all = doc.allCellStyles; }
|
|
32
|
+
} catch (e0) { all = null; }
|
|
33
|
+
if (all !== null && all !== undefined) {
|
|
34
|
+
for (i = 0; i < all.length; i++) { try { list.push(String(all[i].name)); } catch (e1) { /* ohne */ } }
|
|
35
|
+
return list;
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
if (kind === 'paragraph') { collection = doc.paragraphStyles; }
|
|
39
|
+
else if (kind === 'character') { collection = doc.characterStyles; }
|
|
40
|
+
else if (kind === 'object') { collection = doc.objectStyles; }
|
|
41
|
+
else if (kind === 'table') { collection = doc.tableStyles; }
|
|
42
|
+
else if (kind === 'cell') { collection = doc.cellStyles; }
|
|
43
|
+
else if (kind === 'swatches') { collection = doc.swatches; }
|
|
44
|
+
if (collection !== null && collection !== undefined) {
|
|
45
|
+
for (i = 0; i < collection.length; i++) { try { list.push(String(collection.item(i).name)); } catch (e2) { /* ohne */ } }
|
|
46
|
+
}
|
|
47
|
+
} catch (e3) { /* leer */ }
|
|
48
|
+
return list;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function idcNamesNotIn(after, before) {
|
|
52
|
+
var out = [], i, j, seen;
|
|
53
|
+
for (i = 0; i < after.length; i++) {
|
|
54
|
+
seen = false;
|
|
55
|
+
for (j = 0; j < before.length; j++) { if (before[j] === after[i]) { seen = true; break; } }
|
|
56
|
+
if (!seen) { out.push(after[i]); }
|
|
57
|
+
}
|
|
58
|
+
return out;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
IDC.register('import_styles', { needs_document: true, read_only: false, ruler: 'none' },
|
|
62
|
+
function (ctx) {
|
|
63
|
+
var args = ctx.args;
|
|
64
|
+
var doc = ctx.doc;
|
|
65
|
+
var path = args.file_path;
|
|
66
|
+
var kinds = args.kinds;
|
|
67
|
+
var onConflict = args.on_conflict === undefined || args.on_conflict === null ? 'keep_existing' : args.on_conflict;
|
|
68
|
+
var file, strategy, i, j, kind, format, before, after, added, results = {}, totalAdded = 0, lower;
|
|
69
|
+
var ownPath = '';
|
|
70
|
+
|
|
71
|
+
if (typeof path !== 'string' || path === '') {
|
|
72
|
+
IDC.fail('invalid_argument', 'file_path is required (.indd, .indt or .idml).', null);
|
|
73
|
+
}
|
|
74
|
+
lower = path.toLowerCase();
|
|
75
|
+
if (!/\.(indd|indt|idml)$/.test(lower)) {
|
|
76
|
+
IDC.fail('invalid_argument', 'file_path must end in .indd, .indt or .idml.', { file_path: path });
|
|
77
|
+
}
|
|
78
|
+
if (kinds === undefined || kinds === null) {
|
|
79
|
+
kinds = IDC_IMPORT_KINDS.slice();
|
|
80
|
+
}
|
|
81
|
+
if (!IDC.isArray(kinds) || kinds.length === 0) {
|
|
82
|
+
IDC.fail('invalid_argument', 'kinds must be a non-empty list of ' + IDC_IMPORT_KINDS.join(', ') + '.', null);
|
|
83
|
+
}
|
|
84
|
+
for (i = 0; i < kinds.length; i++) {
|
|
85
|
+
if (typeof kinds[i] !== 'string') { IDC.fail('invalid_argument', 'kinds must contain names.', { kinds: kinds }); }
|
|
86
|
+
for (j = 0; j < IDC_IMPORT_KINDS.length; j++) { if (IDC_IMPORT_KINDS[j] === kinds[i]) { break; } }
|
|
87
|
+
if (j === IDC_IMPORT_KINDS.length) {
|
|
88
|
+
IDC.fail('invalid_argument', 'Unknown kind "' + kinds[i] + '"; allowed: ' + IDC_IMPORT_KINDS.join(', ') + '.', { kind: kinds[i] });
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (onConflict !== 'keep_existing' && onConflict !== 'overwrite' && onConflict !== 'rename') {
|
|
92
|
+
IDC.fail('invalid_argument', 'on_conflict must be keep_existing, overwrite or rename.', { on_conflict: onConflict });
|
|
93
|
+
}
|
|
94
|
+
file = IDC.fileFor(path);
|
|
95
|
+
if (!file.exists) {
|
|
96
|
+
IDC.fail('not_found', 'File not found: ' + path, { file_path: path });
|
|
97
|
+
}
|
|
98
|
+
try { ownPath = idcDocumentPath(doc); } catch (e0) { ownPath = ''; }
|
|
99
|
+
if (ownPath !== '' && IDC.fsPath(file) === ownPath) {
|
|
100
|
+
IDC.fail('invalid_argument', 'file_path is the document itself.', { file_path: path });
|
|
101
|
+
}
|
|
102
|
+
strategy = idcClashStrategyFor(onConflict);
|
|
103
|
+
if (strategy === null) {
|
|
104
|
+
IDC.fail('invalid_state', 'This runtime has no GlobalClashResolutionStrategy enumeration.', null);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
for (i = 0; i < kinds.length; i++) {
|
|
108
|
+
kind = kinds[i];
|
|
109
|
+
before = idcStyleNamesOfKind(doc, kind);
|
|
110
|
+
try {
|
|
111
|
+
if (kind === 'swatches') {
|
|
112
|
+
doc.loadSwatches(file);
|
|
113
|
+
} else {
|
|
114
|
+
format = idcImportFormatFor(kind);
|
|
115
|
+
if (format === null) { IDC.fail('invalid_state', 'This runtime has no ImportFormat enumeration.', null); }
|
|
116
|
+
doc.importStyles(format, file, strategy);
|
|
117
|
+
}
|
|
118
|
+
} catch (e1) {
|
|
119
|
+
if (e1 && e1.isIdcError) { throw e1; }
|
|
120
|
+
IDC.fail('io_error', 'InDesign could not import ' + kind + ' styles from ' + path + ': ' + String(e1.message ? e1.message : e1),
|
|
121
|
+
{ file_path: path, kind: kind, imported_so_far: results });
|
|
122
|
+
}
|
|
123
|
+
after = idcStyleNamesOfKind(doc, kind);
|
|
124
|
+
added = idcNamesNotIn(after, before);
|
|
125
|
+
totalAdded += added.length;
|
|
126
|
+
results[kind] = { before: before.length, after: after.length, added: added };
|
|
127
|
+
}
|
|
128
|
+
if (kinds.length > 0 && totalAdded === 0) {
|
|
129
|
+
ctx.warn('No new styles or swatches were added – the file had none of the requested kinds, or all names existed already (on_conflict ' + onConflict + ').');
|
|
130
|
+
}
|
|
131
|
+
if (onConflict === 'overwrite') {
|
|
132
|
+
ctx.warn('on_conflict overwrite: existing styles with the same names were replaced; the counts cannot show which.');
|
|
133
|
+
}
|
|
134
|
+
ctx.changes = { modified_document_ids: [Number(doc.id)] };
|
|
135
|
+
return {
|
|
136
|
+
file_path: IDC.fsPath(file) || path,
|
|
137
|
+
kinds: kinds,
|
|
138
|
+
on_conflict: onConflict,
|
|
139
|
+
results: results,
|
|
140
|
+
total_added: totalAdded
|
|
141
|
+
};
|
|
142
|
+
});
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/* Wunschliste J2 Nr. 18 (Sitzung 7) – Farbfelder auflisten: list_swatches. */
|
|
2
|
+
|
|
3
|
+
function idcColorSpaceName(value) {
|
|
4
|
+
if (value === undefined || value === null) { return null; }
|
|
5
|
+
if (typeof ColorSpace === 'undefined') { return String(value); }
|
|
6
|
+
if (IDC.enumIs(value, ColorSpace.RGB)) { return 'RGB'; }
|
|
7
|
+
if (IDC.enumIs(value, ColorSpace.CMYK)) { return 'CMYK'; }
|
|
8
|
+
try { if (ColorSpace.LAB !== undefined && IDC.enumIs(value, ColorSpace.LAB)) { return 'LAB'; } } catch (e0) { /* kein LAB */ }
|
|
9
|
+
try { if (ColorSpace.MIXEDINK !== undefined && IDC.enumIs(value, ColorSpace.MIXEDINK)) { return 'MIXED_INK'; } } catch (e1) { /* kein MIXEDINK */ }
|
|
10
|
+
return String(value);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function idcColorModelName(value) {
|
|
14
|
+
if (value === undefined || value === null) { return null; }
|
|
15
|
+
if (typeof ColorModel === 'undefined') { return String(value); }
|
|
16
|
+
if (IDC.enumIs(value, ColorModel.PROCESS)) { return 'process'; }
|
|
17
|
+
if (IDC.enumIs(value, ColorModel.SPOT)) { return 'spot'; }
|
|
18
|
+
try { if (ColorModel.REGISTRATION !== undefined && IDC.enumIs(value, ColorModel.REGISTRATION)) { return 'registration'; } } catch (e0) { /* keine */ }
|
|
19
|
+
return String(value);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function idcNumberList(values) {
|
|
23
|
+
var out = [];
|
|
24
|
+
var i;
|
|
25
|
+
if (!values) { return out; }
|
|
26
|
+
for (i = 0; i < values.length; i++) { out.push(IDC.round(Number(values[i]), 3)); }
|
|
27
|
+
return out;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* Sammlung (colors, tints, gradients, mixedInks) durchgehen; fehlt sie, leere Liste. */
|
|
31
|
+
function idcEachIn(doc, collectionName, fn) {
|
|
32
|
+
var collection = null, i, item;
|
|
33
|
+
try { collection = doc[collectionName]; } catch (e0) { collection = null; }
|
|
34
|
+
if (collection === null || collection === undefined) { return; }
|
|
35
|
+
for (i = 0; i < collection.length; i++) {
|
|
36
|
+
try { item = collection.item(i); } catch (e1) { continue; }
|
|
37
|
+
fn(item);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function idcDescribeColor(color) {
|
|
42
|
+
var out = { swatch_id: null, name: null, kind: 'color', space: null, model: null, values: [], tint_percent: null, base_color: null, built_in: false };
|
|
43
|
+
try { out.swatch_id = Number(color.id); } catch (e0) { /* null */ }
|
|
44
|
+
try { out.name = String(color.name); } catch (e1) { /* null */ }
|
|
45
|
+
try { out.space = idcColorSpaceName(color.space); } catch (e2) { /* null */ }
|
|
46
|
+
try { out.model = idcColorModelName(color.model); } catch (e3) { /* null */ }
|
|
47
|
+
try { out.values = idcNumberList(color.colorValue); } catch (e4) { out.values = []; }
|
|
48
|
+
out.built_in = out.name !== null && (out.name === 'Black' || out.name === 'Paper' || out.name === 'Registration' || out.name === 'None' || out.name.charAt(0) === '[');
|
|
49
|
+
return out;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
IDC.register('list_swatches', { needs_document: true, read_only: true, ruler: 'none' },
|
|
53
|
+
function (ctx) {
|
|
54
|
+
var args = ctx.args;
|
|
55
|
+
var doc = ctx.doc;
|
|
56
|
+
var includeBuiltIn = args.include_built_in !== false;
|
|
57
|
+
var out = [];
|
|
58
|
+
var counts = { color: 0, tint: 0, gradient: 0, mixed_ink: 0 };
|
|
59
|
+
var unnamed = 0;
|
|
60
|
+
/* Unbenannte Farben (leerer Name, z. B. Verlaufsstufen) sind per Name nicht erreichbar – nur zaehlen (Live-Fund 05.09.2026). */
|
|
61
|
+
var skipUnnamed = function (entry) {
|
|
62
|
+
if (entry.name === null || entry.name === '') { unnamed += 1; return true; }
|
|
63
|
+
return false;
|
|
64
|
+
};
|
|
65
|
+
var noneSwatch = idcNoneSwatch(doc);
|
|
66
|
+
|
|
67
|
+
if (noneSwatch !== null && includeBuiltIn) {
|
|
68
|
+
out.push({ swatch_id: Number(noneSwatch.id), name: String(noneSwatch.name), kind: 'none', space: null, model: null, values: [], tint_percent: null, base_color: null, built_in: true });
|
|
69
|
+
}
|
|
70
|
+
idcEachIn(doc, 'colors', function (color) {
|
|
71
|
+
var entry = idcDescribeColor(color);
|
|
72
|
+
if (skipUnnamed(entry)) { return; }
|
|
73
|
+
if (entry.built_in && !includeBuiltIn) { return; }
|
|
74
|
+
counts.color += 1;
|
|
75
|
+
out.push(entry);
|
|
76
|
+
});
|
|
77
|
+
idcEachIn(doc, 'tints', function (tint) {
|
|
78
|
+
var entry = { swatch_id: null, name: null, kind: 'tint', space: null, model: null, values: [], tint_percent: null, base_color: null, built_in: false };
|
|
79
|
+
try { entry.swatch_id = Number(tint.id); } catch (e0) { /* null */ }
|
|
80
|
+
try { entry.name = String(tint.name); } catch (e1) { /* null */ }
|
|
81
|
+
try { entry.tint_percent = IDC.round(Number(tint.tintValue), 3); } catch (e2) { /* null */ }
|
|
82
|
+
try { entry.base_color = String(tint.baseColor.name); } catch (e3) { /* null */ }
|
|
83
|
+
try { entry.space = idcColorSpaceName(tint.space); } catch (e4) { /* null */ }
|
|
84
|
+
try { entry.values = idcNumberList(tint.colorValue); } catch (e5) { entry.values = []; }
|
|
85
|
+
if (skipUnnamed(entry)) { return; }
|
|
86
|
+
counts.tint += 1;
|
|
87
|
+
out.push(entry);
|
|
88
|
+
});
|
|
89
|
+
idcEachIn(doc, 'gradients', function (gradient) {
|
|
90
|
+
var entry = { swatch_id: null, name: null, kind: 'gradient', space: null, model: null, values: [], tint_percent: null, base_color: null, built_in: false, stop_count: null };
|
|
91
|
+
try { entry.swatch_id = Number(gradient.id); } catch (e0) { /* null */ }
|
|
92
|
+
try { entry.name = String(gradient.name); } catch (e1) { /* null */ }
|
|
93
|
+
try { entry.stop_count = Number(gradient.gradientStops.length); } catch (e2) { /* null */ }
|
|
94
|
+
/* A-8.4: Art und Stopps. */
|
|
95
|
+
entry.type = idcGradientTypeName((function () { try { return gradient.type; } catch (e3) { return null; } })());
|
|
96
|
+
entry.stops = idcReadGradientStops(gradient);
|
|
97
|
+
if (skipUnnamed(entry)) { return; }
|
|
98
|
+
counts.gradient += 1;
|
|
99
|
+
out.push(entry);
|
|
100
|
+
});
|
|
101
|
+
idcEachIn(doc, 'mixedInks', function (ink) {
|
|
102
|
+
var entry = { swatch_id: null, name: null, kind: 'mixed_ink', space: 'MIXED_INK', model: null, values: [], tint_percent: null, base_color: null, built_in: false };
|
|
103
|
+
try { entry.swatch_id = Number(ink.id); } catch (e0) { /* null */ }
|
|
104
|
+
try { entry.name = String(ink.name); } catch (e1) { /* null */ }
|
|
105
|
+
try { entry.values = idcNumberList(ink.inkPercentages); } catch (e2) { entry.values = []; }
|
|
106
|
+
if (skipUnnamed(entry)) { return; }
|
|
107
|
+
counts.mixed_ink += 1;
|
|
108
|
+
out.push(entry);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
return { swatches: out, count: out.length, counts: counts, unnamed_skipped: unnamed, include_built_in: includeBuiltIn };
|
|
112
|
+
});
|