@kanbun-skam/skam-web-component 0.2.0 → 0.3.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/README.md +93 -34
- package/dist/auto.d.ts +1 -2
- package/dist/auto.js +11 -8
- package/dist/index.d.ts +69 -65
- package/dist/index.js +1 -10
- package/dist/skam-renderer-Bz03E4hy.js +652 -0
- package/package.json +5 -5
- package/dist/chunk-HPIH7MRS.js +0 -454
package/dist/chunk-HPIH7MRS.js
DELETED
|
@@ -1,454 +0,0 @@
|
|
|
1
|
-
// src/xml-extraction.ts
|
|
2
|
-
var SKAM_XML_MEDIA_TYPE = "application/vnd.berlysia.skam+xml";
|
|
3
|
-
function extractXmlFromScriptElement(host) {
|
|
4
|
-
const script = host.querySelector(`script[type="${SKAM_XML_MEDIA_TYPE}"]`);
|
|
5
|
-
if (script) {
|
|
6
|
-
const text = script.textContent?.trim();
|
|
7
|
-
return text || null;
|
|
8
|
-
}
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
function extractXmlFromLightDOM(host) {
|
|
12
|
-
const text = host.textContent;
|
|
13
|
-
if (text && text.trim()) {
|
|
14
|
-
return text;
|
|
15
|
-
}
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
function extractXml(xmlContent, host) {
|
|
19
|
-
if (xmlContent !== void 0) {
|
|
20
|
-
return xmlContent || null;
|
|
21
|
-
}
|
|
22
|
-
const fromScript = extractXmlFromScriptElement(host);
|
|
23
|
-
if (fromScript) {
|
|
24
|
-
return fromScript;
|
|
25
|
-
}
|
|
26
|
-
return extractXmlFromLightDOM(host);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// src/skam-renderer.ts
|
|
30
|
-
import { parse } from "@kanbun-skam/skam-xml-parser";
|
|
31
|
-
import { render, calibrateGridBaseline } from "@kanbun-skam/skam-html-renderer";
|
|
32
|
-
|
|
33
|
-
// src/attribute-map.ts
|
|
34
|
-
import {
|
|
35
|
-
PROFILES,
|
|
36
|
-
resolveRenderProfile,
|
|
37
|
-
validateRenderOptions
|
|
38
|
-
} from "@kanbun-skam/skam-html-renderer";
|
|
39
|
-
var VALID_WRITING_MODES = ["vertical", "horizontal"];
|
|
40
|
-
var VALID_COPYABLE_ELEMENTS = ["ruby", "okurigana", "soegana", "kaeriten", "okototen"];
|
|
41
|
-
function parseWritingMode(value) {
|
|
42
|
-
if (value != null && VALID_WRITING_MODES.includes(value)) {
|
|
43
|
-
return value;
|
|
44
|
-
}
|
|
45
|
-
return "vertical";
|
|
46
|
-
}
|
|
47
|
-
var MAX_ECHO = 64;
|
|
48
|
-
function resolveProfileAttribute(value) {
|
|
49
|
-
if (Object.hasOwn(PROFILES, value)) {
|
|
50
|
-
return resolveRenderProfile({ base: value });
|
|
51
|
-
}
|
|
52
|
-
let parsed;
|
|
53
|
-
try {
|
|
54
|
-
parsed = JSON.parse(value);
|
|
55
|
-
} catch {
|
|
56
|
-
throw new TypeError(
|
|
57
|
-
`profile must be a preset name or a JSON object (got ${JSON.stringify(value.slice(0, MAX_ECHO))})`
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
return resolveRenderProfile(parsed);
|
|
61
|
-
}
|
|
62
|
-
function parseBooleanAttr(value) {
|
|
63
|
-
return value !== null;
|
|
64
|
-
}
|
|
65
|
-
function parseCopyable(value) {
|
|
66
|
-
if (value == null) return void 0;
|
|
67
|
-
if (value === "all") return "all";
|
|
68
|
-
const elements = value.split(/\s+/).filter(
|
|
69
|
-
(v) => VALID_COPYABLE_ELEMENTS.includes(v)
|
|
70
|
-
);
|
|
71
|
-
return elements.length > 0 ? elements : void 0;
|
|
72
|
-
}
|
|
73
|
-
function findUnknownCopyable(value) {
|
|
74
|
-
if (value == null || value === "all") return void 0;
|
|
75
|
-
return value.split(/\s+/).find((v) => v !== "" && !VALID_COPYABLE_ELEMENTS.includes(v));
|
|
76
|
-
}
|
|
77
|
-
function checkAttribute(attribute, probe) {
|
|
78
|
-
try {
|
|
79
|
-
validateRenderOptions(probe);
|
|
80
|
-
return void 0;
|
|
81
|
-
} catch (error) {
|
|
82
|
-
return { attribute, error: toTypeError(error) };
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
function toTypeError(error) {
|
|
86
|
-
return error instanceof TypeError ? error : new TypeError(String(error));
|
|
87
|
-
}
|
|
88
|
-
function parseReadingLayerFlag(value) {
|
|
89
|
-
if (value === "" || value === "true") return true;
|
|
90
|
-
if (value === "false") return false;
|
|
91
|
-
throw new TypeError(
|
|
92
|
-
`include-reading-layer must be "true", "false" or empty (got ${JSON.stringify(value.slice(0, MAX_ECHO))})`
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
function parseReadingLayerSource(value) {
|
|
96
|
-
if (value === "readings" || value === "display") return value;
|
|
97
|
-
throw new TypeError('reading-layer-source must be "readings" or "display"');
|
|
98
|
-
}
|
|
99
|
-
function applyHiddenAnnotationAttributes(attrs, options, blocked) {
|
|
100
|
-
if (attrs.profile !== null) {
|
|
101
|
-
try {
|
|
102
|
-
options.profile = resolveProfileAttribute(attrs.profile);
|
|
103
|
-
} catch (error) {
|
|
104
|
-
blocked.push({ attribute: "profile", error: toTypeError(error) });
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
const readingLayer = attrs["include-reading-layer"];
|
|
108
|
-
if (readingLayer === null) {
|
|
109
|
-
options.includeReadingLayer = true;
|
|
110
|
-
} else {
|
|
111
|
-
try {
|
|
112
|
-
options.includeReadingLayer = parseReadingLayerFlag(readingLayer);
|
|
113
|
-
} catch (error) {
|
|
114
|
-
blocked.push({ attribute: "include-reading-layer", error: toTypeError(error) });
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
const readingLayerSource = attrs["reading-layer-source"] ?? null;
|
|
118
|
-
if (readingLayerSource !== null) {
|
|
119
|
-
try {
|
|
120
|
-
options.readingLayerSource = parseReadingLayerSource(readingLayerSource);
|
|
121
|
-
} catch (error) {
|
|
122
|
-
blocked.push({ attribute: "reading-layer-source", error: toTypeError(error) });
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
function checkWritingModeAndCopyable(attrs) {
|
|
127
|
-
const invalid = [];
|
|
128
|
-
const writingMode = attrs["writing-mode"];
|
|
129
|
-
if (writingMode !== null && !VALID_WRITING_MODES.includes(writingMode)) {
|
|
130
|
-
invalid.push({
|
|
131
|
-
attribute: "writing-mode",
|
|
132
|
-
error: new TypeError('writing-mode must be "vertical" or "horizontal"')
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
if (findUnknownCopyable(attrs.copyable) !== void 0) {
|
|
136
|
-
invalid.push({
|
|
137
|
-
attribute: "copyable",
|
|
138
|
-
error: new TypeError(
|
|
139
|
-
'copyable must be "all" or a space-separated list of known element names'
|
|
140
|
-
)
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
return invalid;
|
|
144
|
-
}
|
|
145
|
-
function buildRenderOptions(attrs) {
|
|
146
|
-
const options = {
|
|
147
|
-
writingMode: parseWritingMode(attrs["writing-mode"]),
|
|
148
|
-
useLayer: false
|
|
149
|
-
// Shadow DOM doesn't need @layer
|
|
150
|
-
};
|
|
151
|
-
if (parseBooleanAttr(attrs.inline)) {
|
|
152
|
-
options.inline = true;
|
|
153
|
-
}
|
|
154
|
-
const blocked = [];
|
|
155
|
-
applyHiddenAnnotationAttributes(attrs, options, blocked);
|
|
156
|
-
const copyable = parseCopyable(attrs.copyable);
|
|
157
|
-
if (copyable) {
|
|
158
|
-
options.copyable = copyable;
|
|
159
|
-
}
|
|
160
|
-
const invalid = checkWritingModeAndCopyable(attrs);
|
|
161
|
-
const classPrefix = attrs["class-prefix"];
|
|
162
|
-
if (classPrefix != null) {
|
|
163
|
-
const problem = checkAttribute("class-prefix", { classPrefix });
|
|
164
|
-
if (problem) invalid.push(problem);
|
|
165
|
-
else options.classPrefix = classPrefix;
|
|
166
|
-
}
|
|
167
|
-
const displayLang = attrs["display-lang"];
|
|
168
|
-
if (displayLang != null) {
|
|
169
|
-
const problem = checkAttribute("display-lang", { displayLang });
|
|
170
|
-
if (problem) invalid.push(problem);
|
|
171
|
-
else options.displayLang = displayLang;
|
|
172
|
-
}
|
|
173
|
-
return { options, invalid, blocked };
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
// src/font-loader.ts
|
|
177
|
-
var DEFAULT_FONT_FAMILY = "Noto Serif JP";
|
|
178
|
-
var GOOGLE_FONTS_URL = "https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@400;700&display=swap";
|
|
179
|
-
var LINK_SELECTOR = 'link[href*="fonts.googleapis.com"][href*="Noto+Serif+JP"]';
|
|
180
|
-
function injectGoogleFontsLink() {
|
|
181
|
-
if (typeof document === "undefined") return;
|
|
182
|
-
if (!document.querySelector(LINK_SELECTOR)) {
|
|
183
|
-
const link = document.createElement("link");
|
|
184
|
-
link.rel = "stylesheet";
|
|
185
|
-
link.href = GOOGLE_FONTS_URL;
|
|
186
|
-
document.head.appendChild(link);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
function buildFontStyle(variablePrefix) {
|
|
190
|
-
const family = `"${DEFAULT_FONT_FAMILY}", serif`;
|
|
191
|
-
return `:host {
|
|
192
|
-
--${variablePrefix}-font-family: ${family};
|
|
193
|
-
--${variablePrefix}-font-family-ruby: ${family};
|
|
194
|
-
}`;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// src/skam-renderer.ts
|
|
198
|
-
var ERROR_CSS = `
|
|
199
|
-
[role="alert"] {
|
|
200
|
-
color: #c00;
|
|
201
|
-
padding: 0.5em;
|
|
202
|
-
font-family: monospace;
|
|
203
|
-
white-space: pre-wrap;
|
|
204
|
-
}
|
|
205
|
-
`;
|
|
206
|
-
function generateVarOverrideCss(prefix) {
|
|
207
|
-
const vp = prefix;
|
|
208
|
-
return `
|
|
209
|
-
:host {
|
|
210
|
-
--${vp}-color-fg: currentColor;
|
|
211
|
-
--${vp}-color-kaeriten: currentColor;
|
|
212
|
-
--${vp}-color-ruby: currentColor;
|
|
213
|
-
--${vp}-color-emphasis: currentColor;
|
|
214
|
-
--${vp}-glyph-size: 1em;
|
|
215
|
-
--${vp}-ruby-ratio: 0.5;
|
|
216
|
-
--${vp}-line-height: 2;
|
|
217
|
-
--${vp}-letter-spacing: 0;
|
|
218
|
-
}
|
|
219
|
-
.${vp}-document {
|
|
220
|
-
--${vp}-color-fg: inherit;
|
|
221
|
-
--${vp}-color-kaeriten: inherit;
|
|
222
|
-
--${vp}-color-ruby: inherit;
|
|
223
|
-
--${vp}-color-emphasis: inherit;
|
|
224
|
-
--${vp}-font-family: inherit;
|
|
225
|
-
--${vp}-font-family-ruby: inherit;
|
|
226
|
-
--${vp}-glyph-size: inherit;
|
|
227
|
-
--${vp}-ruby-ratio: inherit;
|
|
228
|
-
--${vp}-line-height: inherit;
|
|
229
|
-
--${vp}-letter-spacing: inherit;
|
|
230
|
-
}`;
|
|
231
|
-
}
|
|
232
|
-
var BaseElement = typeof HTMLElement === "undefined" ? class {
|
|
233
|
-
} : HTMLElement;
|
|
234
|
-
var SkamRendererElement = class extends BaseElement {
|
|
235
|
-
static observedAttributes = [
|
|
236
|
-
"writing-mode",
|
|
237
|
-
"profile",
|
|
238
|
-
"inline",
|
|
239
|
-
"include-reading-layer",
|
|
240
|
-
"reading-layer-source",
|
|
241
|
-
"copyable",
|
|
242
|
-
"class-prefix",
|
|
243
|
-
"display-lang",
|
|
244
|
-
"auto-font"
|
|
245
|
-
];
|
|
246
|
-
#shadow;
|
|
247
|
-
#mainStyle;
|
|
248
|
-
#errorStyle;
|
|
249
|
-
#fontStyle;
|
|
250
|
-
#contentDiv;
|
|
251
|
-
#xmlContent;
|
|
252
|
-
#observer = null;
|
|
253
|
-
#rafId = null;
|
|
254
|
-
/** 最後に skam-error で通知した不正値 (属性名 → 値)。同じ値では再通知しない */
|
|
255
|
-
#reportedInvalid = /* @__PURE__ */ new Map();
|
|
256
|
-
/** fail closed で通知済みの属性 → 値。同じ値では再通知しない */
|
|
257
|
-
#reportedBlocked = /* @__PURE__ */ new Map();
|
|
258
|
-
constructor() {
|
|
259
|
-
super();
|
|
260
|
-
this.#shadow = this.attachShadow({ mode: "open" });
|
|
261
|
-
this.#mainStyle = document.createElement("style");
|
|
262
|
-
this.#mainStyle.id = "main-css";
|
|
263
|
-
this.#errorStyle = document.createElement("style");
|
|
264
|
-
this.#errorStyle.id = "error-css";
|
|
265
|
-
this.#errorStyle.textContent = ERROR_CSS;
|
|
266
|
-
this.#fontStyle = document.createElement("style");
|
|
267
|
-
this.#fontStyle.id = "font-css";
|
|
268
|
-
this.#contentDiv = document.createElement("div");
|
|
269
|
-
this.#contentDiv.id = "content";
|
|
270
|
-
this.#shadow.appendChild(this.#fontStyle);
|
|
271
|
-
this.#shadow.appendChild(this.#mainStyle);
|
|
272
|
-
this.#shadow.appendChild(this.#errorStyle);
|
|
273
|
-
this.#shadow.appendChild(this.#contentDiv);
|
|
274
|
-
}
|
|
275
|
-
/**
|
|
276
|
-
* XML コンテンツをプログラマティックに設定する。
|
|
277
|
-
* undefined の場合は <script type="application/vnd.berlysia.skam+xml"> や Light DOM にフォールバック。
|
|
278
|
-
* 空文字列 "" も「設定済み」とみなし、フォールバックしない。
|
|
279
|
-
*/
|
|
280
|
-
get xmlContent() {
|
|
281
|
-
return this.#xmlContent;
|
|
282
|
-
}
|
|
283
|
-
set xmlContent(value) {
|
|
284
|
-
this.#xmlContent = value;
|
|
285
|
-
this.#scheduleRender();
|
|
286
|
-
}
|
|
287
|
-
connectedCallback() {
|
|
288
|
-
this.#ensureFont();
|
|
289
|
-
this.#observer = new MutationObserver(() => {
|
|
290
|
-
this.#scheduleRender();
|
|
291
|
-
});
|
|
292
|
-
this.#observer.observe(this, {
|
|
293
|
-
childList: true,
|
|
294
|
-
subtree: true,
|
|
295
|
-
characterData: true
|
|
296
|
-
});
|
|
297
|
-
this.#scheduleRender();
|
|
298
|
-
}
|
|
299
|
-
disconnectedCallback() {
|
|
300
|
-
this.#observer?.disconnect();
|
|
301
|
-
this.#observer = null;
|
|
302
|
-
if (this.#rafId !== null) {
|
|
303
|
-
cancelAnimationFrame(this.#rafId);
|
|
304
|
-
this.#rafId = null;
|
|
305
|
-
}
|
|
306
|
-
this.#reportedInvalid.clear();
|
|
307
|
-
this.#reportedBlocked.clear();
|
|
308
|
-
}
|
|
309
|
-
attributeChangedCallback(_name, _oldValue, _newValue) {
|
|
310
|
-
this.#scheduleRender();
|
|
311
|
-
}
|
|
312
|
-
#scheduleRender() {
|
|
313
|
-
if (this.#rafId !== null) return;
|
|
314
|
-
this.#rafId = requestAnimationFrame(() => {
|
|
315
|
-
this.#rafId = null;
|
|
316
|
-
this.#performRender();
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
#performRender() {
|
|
320
|
-
const attrs = this.#getAttributeValues();
|
|
321
|
-
const { options, invalid, blocked } = buildRenderOptions(attrs);
|
|
322
|
-
if (blocked.length > 0) {
|
|
323
|
-
this.#renderBlocked(blocked, attrs);
|
|
324
|
-
return;
|
|
325
|
-
}
|
|
326
|
-
this.#reportedBlocked.clear();
|
|
327
|
-
const xml = extractXml(this.#xmlContent, this);
|
|
328
|
-
if (!xml) {
|
|
329
|
-
this.#contentDiv.innerHTML = "";
|
|
330
|
-
this.#mainStyle.textContent = "";
|
|
331
|
-
return;
|
|
332
|
-
}
|
|
333
|
-
try {
|
|
334
|
-
const doc = parse(xml);
|
|
335
|
-
const { html, css } = render(doc, options);
|
|
336
|
-
const prefix = options.classPrefix ?? "skam";
|
|
337
|
-
this.#mainStyle.textContent = css + generateVarOverrideCss(prefix);
|
|
338
|
-
this.#ensureFont();
|
|
339
|
-
this.#updateFontStyle(prefix);
|
|
340
|
-
this.#contentDiv.innerHTML = html;
|
|
341
|
-
calibrateGridBaseline(this.#contentDiv, {
|
|
342
|
-
variablePrefix: prefix
|
|
343
|
-
});
|
|
344
|
-
this.#reportInvalid(invalid, attrs);
|
|
345
|
-
this.dispatchEvent(
|
|
346
|
-
new CustomEvent("skam-render", {
|
|
347
|
-
detail: { document: doc },
|
|
348
|
-
bubbles: true,
|
|
349
|
-
composed: true
|
|
350
|
-
})
|
|
351
|
-
);
|
|
352
|
-
} catch (error) {
|
|
353
|
-
this.#handleError(error);
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
/**
|
|
357
|
-
* 既定値に戻した属性を回復可能なエラーとして通知する (内容は消さない)。
|
|
358
|
-
* 同じ不正値が残っている間は再描画しても再通知しない。ハンドラが属性や内容を
|
|
359
|
-
* 書き換えたときに、エラー → 再描画 → エラーの連鎖が起きるのを避けるため。
|
|
360
|
-
*/
|
|
361
|
-
#reportInvalid(invalid, attrs) {
|
|
362
|
-
const invalidNames = new Set(invalid.map((i) => i.attribute));
|
|
363
|
-
for (const name of this.#reportedInvalid.keys()) {
|
|
364
|
-
if (!invalidNames.has(name)) this.#reportedInvalid.delete(name);
|
|
365
|
-
}
|
|
366
|
-
for (const { attribute, error } of invalid) {
|
|
367
|
-
const value = attrs[attribute] ?? "";
|
|
368
|
-
if (this.#reportedInvalid.get(attribute) === value) continue;
|
|
369
|
-
this.#reportedInvalid.set(attribute, value);
|
|
370
|
-
this.dispatchEvent(
|
|
371
|
-
new CustomEvent("skam-error", {
|
|
372
|
-
detail: { error, recoverable: true, attribute },
|
|
373
|
-
bubbles: true,
|
|
374
|
-
composed: true
|
|
375
|
-
})
|
|
376
|
-
);
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
/**
|
|
380
|
-
* 隠す属性が不正なとき、描いた内容を消してメッセージだけを出す。
|
|
381
|
-
* 同じ属性の同じ値では再通知しない (#reportInvalid と同じ理由)。
|
|
382
|
-
* detail には属性の生の値を入れない。値は 64 文字に切り詰めてメッセージに含まれる。
|
|
383
|
-
*/
|
|
384
|
-
#renderBlocked(blocked, attrs) {
|
|
385
|
-
const names = new Set(blocked.map((b) => b.attribute));
|
|
386
|
-
for (const name of this.#reportedBlocked.keys()) {
|
|
387
|
-
if (!names.has(name)) this.#reportedBlocked.delete(name);
|
|
388
|
-
}
|
|
389
|
-
this.#contentDiv.innerHTML = "";
|
|
390
|
-
const alert = document.createElement("div");
|
|
391
|
-
alert.setAttribute("role", "alert");
|
|
392
|
-
alert.textContent = blocked.map((b) => b.error.message).join("\n");
|
|
393
|
-
this.#contentDiv.appendChild(alert);
|
|
394
|
-
for (const { attribute, error } of blocked) {
|
|
395
|
-
const value = attrs[attribute] ?? "";
|
|
396
|
-
if (this.#reportedBlocked.get(attribute) === value) continue;
|
|
397
|
-
this.#reportedBlocked.set(attribute, value);
|
|
398
|
-
this.dispatchEvent(
|
|
399
|
-
new CustomEvent("skam-error", {
|
|
400
|
-
detail: { error, recoverable: false, attribute },
|
|
401
|
-
bubbles: true,
|
|
402
|
-
composed: true
|
|
403
|
-
})
|
|
404
|
-
);
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
#handleError(error) {
|
|
408
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
409
|
-
this.#contentDiv.innerHTML = "";
|
|
410
|
-
const alert = document.createElement("div");
|
|
411
|
-
alert.setAttribute("role", "alert");
|
|
412
|
-
alert.textContent = message;
|
|
413
|
-
this.#contentDiv.appendChild(alert);
|
|
414
|
-
this.dispatchEvent(
|
|
415
|
-
new CustomEvent("skam-error", {
|
|
416
|
-
detail: { error, recoverable: false },
|
|
417
|
-
bubbles: true,
|
|
418
|
-
composed: true
|
|
419
|
-
})
|
|
420
|
-
);
|
|
421
|
-
}
|
|
422
|
-
/** auto-font 属性があれば Google Fonts <link> を document.head に注入 */
|
|
423
|
-
#ensureFont() {
|
|
424
|
-
if (this.hasAttribute("auto-font")) {
|
|
425
|
-
injectGoogleFontsLink();
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
/** Shadow DOM 内のフォント CSS Variable を更新(auto-font 時のみ設定) */
|
|
429
|
-
#updateFontStyle(variablePrefix) {
|
|
430
|
-
if (this.hasAttribute("auto-font")) {
|
|
431
|
-
this.#fontStyle.textContent = buildFontStyle(variablePrefix);
|
|
432
|
-
} else {
|
|
433
|
-
this.#fontStyle.textContent = "";
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
#getAttributeValues() {
|
|
437
|
-
return {
|
|
438
|
-
"writing-mode": this.getAttribute("writing-mode"),
|
|
439
|
-
profile: this.getAttribute("profile"),
|
|
440
|
-
inline: this.getAttribute("inline"),
|
|
441
|
-
"include-reading-layer": this.getAttribute("include-reading-layer"),
|
|
442
|
-
copyable: this.getAttribute("copyable"),
|
|
443
|
-
"class-prefix": this.getAttribute("class-prefix"),
|
|
444
|
-
"display-lang": this.getAttribute("display-lang"),
|
|
445
|
-
"reading-layer-source": this.getAttribute("reading-layer-source")
|
|
446
|
-
};
|
|
447
|
-
}
|
|
448
|
-
};
|
|
449
|
-
|
|
450
|
-
export {
|
|
451
|
-
SKAM_XML_MEDIA_TYPE,
|
|
452
|
-
extractXmlFromScriptElement,
|
|
453
|
-
SkamRendererElement
|
|
454
|
-
};
|