plggmatic 0.5.13 → 0.5.15
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/dist/Appearance/usecase/appearanceCss.d.ts.map +1 -1
- package/dist/Component/usecase/docPager.d.ts +4 -3
- package/dist/Component/usecase/docPager.d.ts.map +1 -1
- package/dist/Shell/usecase/docChrome.d.ts.map +1 -1
- package/dist/index.es.js +263 -33
- package/dist/styleEntry.es.js +259 -30
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appearanceCss.d.ts","sourceRoot":"","sources":["../../../src/Appearance/usecase/appearanceCss.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAUzD,OAAO,EACL,KAAK,UAAU,EAEhB,MAAM,uCAAuC,CAAC;AAE/C;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,aAAa,UAChB,KAAK,SACT,UAAU,KAAG,
|
|
1
|
+
{"version":3,"file":"appearanceCss.d.ts","sourceRoot":"","sources":["../../../src/Appearance/usecase/appearanceCss.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAUzD,OAAO,EACL,KAAK,UAAU,EAEhB,MAAM,uCAAuC,CAAC;AAE/C;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,aAAa,UAChB,KAAK,SACT,UAAU,KAAG,OAsOhB,CAAC"}
|
|
@@ -26,9 +26,10 @@ export type DocPagerProps = Readonly<{
|
|
|
26
26
|
export declare const docPager: (props: DocPagerProps) => Html<never, "nav">;
|
|
27
27
|
export { docPagerClass, docPagerLinkClass, docPagerDirClass, docPagerTitleClass, };
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
29
|
+
* A quiet line under the page: the previous page's title
|
|
30
|
+
* after a left chevron, the next page's before a right
|
|
31
|
+
* one. The direction words stay for assistive technology
|
|
32
|
+
* only.
|
|
32
33
|
*/
|
|
33
34
|
export declare const docPagerCss: SoftStr;
|
|
34
35
|
//# sourceMappingURL=docPager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docPager.d.ts","sourceRoot":"","sources":["../../../src/Component/usecase/docPager.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,OAAO,EAEb,MAAM,MAAM,CAAC;AACd,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,KAAK,IAAI,EAOV,MAAM,WAAW,CAAC;AAQnB,yDAAyD;AACzD,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAClC,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;CACf,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC;IACnC,KAAK,EAAE,OAAO,CAAC;IACf,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;CAC5B,CAAC,CAAC;AAqCH;;;;GAIG;AACH,eAAO,MAAM,QAAQ,UACZ,aAAa,KACnB,IAAI,CAAC,KAAK,EAAE,KAAK,CAgBjB,CAAC;AAEJ,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,GACnB,CAAC;AAKF
|
|
1
|
+
{"version":3,"file":"docPager.d.ts","sourceRoot":"","sources":["../../../src/Component/usecase/docPager.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,OAAO,EAEb,MAAM,MAAM,CAAC;AACd,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,KAAK,IAAI,EAOV,MAAM,WAAW,CAAC;AAQnB,yDAAyD;AACzD,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAClC,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;CACf,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC;IACnC,KAAK,EAAE,OAAO,CAAC;IACf,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;CAC5B,CAAC,CAAC;AAqCH;;;;GAIG;AACH,eAAO,MAAM,QAAQ,UACZ,aAAa,KACnB,IAAI,CAAC,KAAK,EAAE,KAAK,CAgBjB,CAAC;AAEJ,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,GACnB,CAAC;AAKF;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,OAsBoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docChrome.d.ts","sourceRoot":"","sources":["../../../src/Shell/usecase/docChrome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AAapC,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAM7C;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,cAAc,UAClB,KAAK,KACX,OAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"docChrome.d.ts","sourceRoot":"","sources":["../../../src/Shell/usecase/docChrome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AAapC,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAM7C;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,cAAc,UAClB,KAAK,KACX,OAAuC,CAAC;AA45B3C;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,UACvB,KAAK,KACX,OAKG,CAAC;AAEP;;;GAGG;AACH,eAAO,MAAM,YAAY,UAChB,KAAK,KACX,OA8FF,CAAC"}
|
package/dist/index.es.js
CHANGED
|
@@ -2359,7 +2359,7 @@ const link = `a.${classHooks_1.headingAnchorClass}`;
|
|
|
2359
2359
|
const heading = ":is(h1,h2,h3,h4,h5,h6)[id]";
|
|
2360
2360
|
const headingLink = `${heading} ${link}`;
|
|
2361
2361
|
exports.headingAnchorSystemCss = `${headingLink}{color:inherit;font:inherit;text-decoration:none;cursor:pointer}`;
|
|
2362
|
-
const headingAnchorAppearanceCss = (theme) => `${headingLink}{padding:.04em .3em;margin-inline:-.3em;border-radius
|
|
2362
|
+
const headingAnchorAppearanceCss = (theme) => `${headingLink}{padding:.04em .3em;margin-inline:-.3em;border-radius:0;background:none;color:${(0, Style_1.colorVar)(theme)("text")};text-decoration:none;box-decoration-break:clone;-webkit-box-decoration-break:clone}` +
|
|
2363
2363
|
`${headingLink}:is(:hover,:focus-visible){background:color-mix(in srgb,${(0, Style_1.colorVar)(theme)("text")} 7%,transparent);color:${(0, Style_1.colorVar)(theme)("text")};text-decoration:none;outline:0}`;
|
|
2364
2364
|
exports.headingAnchorAppearanceCss = headingAnchorAppearanceCss;
|
|
2365
2365
|
|
|
@@ -2399,23 +2399,28 @@ const docPager = (props) => (0, plgg_view_1.nav)([
|
|
|
2399
2399
|
exports.docPager = docPager;
|
|
2400
2400
|
const box = `.${classHooks_1.docPagerClass}`;
|
|
2401
2401
|
const item = `${box} a.${classHooks_1.docPagerLinkClass}`;
|
|
2402
|
-
exports.docPagerCss = `${box}{display:
|
|
2403
|
-
`
|
|
2404
|
-
`
|
|
2405
|
-
`${item}{display:flex;
|
|
2406
|
-
`
|
|
2407
|
-
`
|
|
2408
|
-
`color:${cvar("
|
|
2409
|
-
`${item}
|
|
2410
|
-
`${item}
|
|
2411
|
-
`
|
|
2412
|
-
|
|
2413
|
-
`
|
|
2414
|
-
|
|
2415
|
-
`
|
|
2416
|
-
|
|
2417
|
-
`
|
|
2418
|
-
|
|
2402
|
+
exports.docPagerCss = `${box}{display:flex;justify-content:space-between;` +
|
|
2403
|
+
`gap:1rem;margin-top:32px;padding-top:12px;` +
|
|
2404
|
+
`border-top:1px solid ${cvar("border")};max-width:46em}` +
|
|
2405
|
+
`${item}{display:inline-flex;align-items:center;` +
|
|
2406
|
+
`gap:.35rem;min-width:0;padding:.15rem .35rem;` +
|
|
2407
|
+
`margin-inline:-.35rem;text-decoration:none;` +
|
|
2408
|
+
`color:${cvar("muted")}}` +
|
|
2409
|
+
`${item}[data-dir="next"]{margin-left:auto}` +
|
|
2410
|
+
`${item}::before,${item}::after{flex:none;` +
|
|
2411
|
+
`width:.42rem;height:.42rem;` +
|
|
2412
|
+
`border-right:1.5px solid currentColor;` +
|
|
2413
|
+
`border-bottom:1.5px solid currentColor}` +
|
|
2414
|
+
`${item}[data-dir="prev"]::before{content:"";` +
|
|
2415
|
+
`transform:rotate(135deg)}` +
|
|
2416
|
+
`${item}[data-dir="next"]::after{content:"";` +
|
|
2417
|
+
`transform:rotate(-45deg)}` +
|
|
2418
|
+
`.${classHooks_1.docPagerDirClass}{position:absolute;width:1px;` +
|
|
2419
|
+
`height:1px;overflow:hidden;clip-path:inset(50%);` +
|
|
2420
|
+
`white-space:nowrap}` +
|
|
2421
|
+
`.${classHooks_1.docPagerTitleClass}{font-size:13px;` +
|
|
2422
|
+
`line-height:20px;font-weight:400;overflow:hidden;` +
|
|
2423
|
+
`text-overflow:ellipsis;white-space:nowrap}`;
|
|
2419
2424
|
|
|
2420
2425
|
},
|
|
2421
2426
|
"src/Component/usecase/hero.ts": function (module, exports, require) {
|
|
@@ -3029,8 +3034,9 @@ const dress = (c) => {
|
|
|
3029
3034
|
bar.append(controls);
|
|
3030
3035
|
drawerLabel.replaceWith(toggle);
|
|
3031
3036
|
for (const selector of [
|
|
3032
|
-
"." + p + "-
|
|
3037
|
+
"." + p + "-chrome-links",
|
|
3033
3038
|
"." + p + "-theme-toggle",
|
|
3039
|
+
"." + p + "-lang",
|
|
3034
3040
|
]) {
|
|
3035
3041
|
const control = bar.querySelector(selector);
|
|
3036
3042
|
if (control)
|
|
@@ -3091,7 +3097,10 @@ const dress = (c) => {
|
|
|
3091
3097
|
const foot = document.createElement("footer");
|
|
3092
3098
|
foot.className = p + "-doc-shell-foot";
|
|
3093
3099
|
foot.textContent = footText;
|
|
3094
|
-
|
|
3100
|
+
if (sidebar)
|
|
3101
|
+
sidebar.append(foot);
|
|
3102
|
+
else
|
|
3103
|
+
strip.after(foot);
|
|
3095
3104
|
}
|
|
3096
3105
|
const status = document.createElement("p");
|
|
3097
3106
|
status.className = p + "-doc-status";
|
|
@@ -3143,6 +3152,148 @@ const dress = (c) => {
|
|
|
3143
3152
|
.writeText(value)
|
|
3144
3153
|
.then(() => announce(done), fallback);
|
|
3145
3154
|
};
|
|
3155
|
+
const markdownOf = (root) => {
|
|
3156
|
+
const skip = (el) => el.matches("button,svg,script,style,template,input,select,textarea,[aria-hidden='true'],[hidden],." +
|
|
3157
|
+
p +
|
|
3158
|
+
"-example,." +
|
|
3159
|
+
p +
|
|
3160
|
+
"-docpager,." +
|
|
3161
|
+
c.doc +
|
|
3162
|
+
"-code-copy");
|
|
3163
|
+
const inline = (node) => {
|
|
3164
|
+
if (node.nodeType === Node.TEXT_NODE)
|
|
3165
|
+
return (node.textContent ?? "").replace(/\s+/g, " ");
|
|
3166
|
+
if (!(node instanceof Element) ||
|
|
3167
|
+
skip(node))
|
|
3168
|
+
return "";
|
|
3169
|
+
const inner = Array.from(node.childNodes)
|
|
3170
|
+
.map(inline)
|
|
3171
|
+
.join("");
|
|
3172
|
+
const tag = node.tagName.toLowerCase();
|
|
3173
|
+
if (tag === "code")
|
|
3174
|
+
return "`" + inner + "`";
|
|
3175
|
+
if (tag === "strong" || tag === "b")
|
|
3176
|
+
return inner.trim() === ""
|
|
3177
|
+
? ""
|
|
3178
|
+
: "**" + inner + "**";
|
|
3179
|
+
if (tag === "em" || tag === "i")
|
|
3180
|
+
return inner.trim() === ""
|
|
3181
|
+
? ""
|
|
3182
|
+
: "*" + inner + "*";
|
|
3183
|
+
if (tag === "br")
|
|
3184
|
+
return " \n";
|
|
3185
|
+
if (tag === "img")
|
|
3186
|
+
return (" +
|
|
3192
|
+
")");
|
|
3193
|
+
if (tag === "a" &&
|
|
3194
|
+
node instanceof HTMLAnchorElement) {
|
|
3195
|
+
const text = inner.trim();
|
|
3196
|
+
const href = node.href;
|
|
3197
|
+
return text === "" || href === ""
|
|
3198
|
+
? text
|
|
3199
|
+
: node.classList.contains(p + "-heading-anchor")
|
|
3200
|
+
? text
|
|
3201
|
+
: "[" + text + "](" + href + ")";
|
|
3202
|
+
}
|
|
3203
|
+
return inner;
|
|
3204
|
+
};
|
|
3205
|
+
const block = (node, depth) => {
|
|
3206
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
3207
|
+
const text = inline(node).trim();
|
|
3208
|
+
return text === "" ? "" : text + "\n\n";
|
|
3209
|
+
}
|
|
3210
|
+
if (!(node instanceof Element) ||
|
|
3211
|
+
skip(node))
|
|
3212
|
+
return "";
|
|
3213
|
+
const tag = node.tagName.toLowerCase();
|
|
3214
|
+
const heading = /^h([1-6])$/.exec(tag);
|
|
3215
|
+
if (heading)
|
|
3216
|
+
return ("#".repeat(Number(heading[1])) +
|
|
3217
|
+
" " +
|
|
3218
|
+
inline(node).trim() +
|
|
3219
|
+
"\n\n");
|
|
3220
|
+
if (tag === "p") {
|
|
3221
|
+
const text = inline(node).trim();
|
|
3222
|
+
return text === "" ? "" : text + "\n\n";
|
|
3223
|
+
}
|
|
3224
|
+
if (tag === "pre") {
|
|
3225
|
+
const code = node.querySelector("code");
|
|
3226
|
+
const lang = code
|
|
3227
|
+
? (/language-([\w-]+)/.exec(code.className)?.[1] ?? "")
|
|
3228
|
+
: "";
|
|
3229
|
+
const body = (code ?? node).textContent ?? "";
|
|
3230
|
+
return ("```" +
|
|
3231
|
+
lang +
|
|
3232
|
+
"\n" +
|
|
3233
|
+
body.replace(/\n$/, "") +
|
|
3234
|
+
"\n```\n\n");
|
|
3235
|
+
}
|
|
3236
|
+
if (tag === "ul" || tag === "ol") {
|
|
3237
|
+
const items = Array.from(node.children).filter((li) => li.tagName.toLowerCase() === "li");
|
|
3238
|
+
return (items
|
|
3239
|
+
.map((li, i) => {
|
|
3240
|
+
const mark = tag === "ol"
|
|
3241
|
+
? String(i + 1) + ". "
|
|
3242
|
+
: "- ";
|
|
3243
|
+
const own = Array.from(li.childNodes)
|
|
3244
|
+
.filter((n) => !(n instanceof Element &&
|
|
3245
|
+
/^(ul|ol)$/i.test(n.tagName)))
|
|
3246
|
+
.map(inline)
|
|
3247
|
+
.join("")
|
|
3248
|
+
.trim();
|
|
3249
|
+
const nested = Array.from(li.children)
|
|
3250
|
+
.filter((n) => /^(ul|ol)$/i.test(n.tagName))
|
|
3251
|
+
.map((n) => block(n, depth + 1))
|
|
3252
|
+
.join("");
|
|
3253
|
+
return (" ".repeat(depth) +
|
|
3254
|
+
mark +
|
|
3255
|
+
own +
|
|
3256
|
+
"\n" +
|
|
3257
|
+
nested.replace(/\n\n$/, "\n"));
|
|
3258
|
+
})
|
|
3259
|
+
.join("") + (depth === 0 ? "\n" : ""));
|
|
3260
|
+
}
|
|
3261
|
+
if (tag === "blockquote")
|
|
3262
|
+
return (Array.from(node.childNodes)
|
|
3263
|
+
.map((n) => block(n, depth))
|
|
3264
|
+
.join("")
|
|
3265
|
+
.trim()
|
|
3266
|
+
.split("\n")
|
|
3267
|
+
.map((line) => "> " + line)
|
|
3268
|
+
.join("\n") + "\n\n");
|
|
3269
|
+
if (tag === "hr")
|
|
3270
|
+
return "---\n\n";
|
|
3271
|
+
if (tag === "table") {
|
|
3272
|
+
const rows = Array.from(node.querySelectorAll("tr")).map((tr) => "| " +
|
|
3273
|
+
Array.from(tr.children)
|
|
3274
|
+
.map((cell) => inline(cell)
|
|
3275
|
+
.trim()
|
|
3276
|
+
.replace(/\|/g, "\\|"))
|
|
3277
|
+
.join(" | ") +
|
|
3278
|
+
" |");
|
|
3279
|
+
if (rows.length === 0)
|
|
3280
|
+
return "";
|
|
3281
|
+
const width = node.querySelector("tr")?.children
|
|
3282
|
+
.length ?? 1;
|
|
3283
|
+
return ([
|
|
3284
|
+
rows[0],
|
|
3285
|
+
"|" + " --- |".repeat(width),
|
|
3286
|
+
...rows.slice(1),
|
|
3287
|
+
].join("\n") + "\n\n");
|
|
3288
|
+
}
|
|
3289
|
+
return Array.from(node.childNodes)
|
|
3290
|
+
.map((n) => block(n, depth))
|
|
3291
|
+
.join("");
|
|
3292
|
+
};
|
|
3293
|
+
return (block(root, 0)
|
|
3294
|
+
.replace(/\n{3,}/g, "\n\n")
|
|
3295
|
+
.trim() + "\n");
|
|
3296
|
+
};
|
|
3146
3297
|
const addActions = (col, mount) => {
|
|
3147
3298
|
const menu = document.createElement("details");
|
|
3148
3299
|
menu.className = actionsClass;
|
|
@@ -3167,6 +3318,29 @@ const dress = (c) => {
|
|
|
3167
3318
|
const folder = col.querySelector("." + c.fold);
|
|
3168
3319
|
if (folder)
|
|
3169
3320
|
folder.click();
|
|
3321
|
+
else {
|
|
3322
|
+
const at = columns().indexOf(col);
|
|
3323
|
+
const params = new URLSearchParams(window.location.search);
|
|
3324
|
+
const rest = (params.get("c") ?? "")
|
|
3325
|
+
.split(",")
|
|
3326
|
+
.filter((entry) => entry !== "");
|
|
3327
|
+
if (at > 0 && at - 1 < rest.length) {
|
|
3328
|
+
rest.splice(at - 1, 1);
|
|
3329
|
+
if (rest.length === 0)
|
|
3330
|
+
params.delete("c");
|
|
3331
|
+
else
|
|
3332
|
+
params.set("c", rest.join(","));
|
|
3333
|
+
const query = params.toString();
|
|
3334
|
+
window.history.pushState(null, "", window.location.pathname +
|
|
3335
|
+
(query === ""
|
|
3336
|
+
? ""
|
|
3337
|
+
: "?" +
|
|
3338
|
+
query
|
|
3339
|
+
.replace(/%2F/gi, "/")
|
|
3340
|
+
.replace(/%2C/gi, ",")));
|
|
3341
|
+
window.dispatchEvent(new PopStateEvent("popstate"));
|
|
3342
|
+
}
|
|
3343
|
+
}
|
|
3170
3344
|
const last = columns().pop();
|
|
3171
3345
|
const next = last
|
|
3172
3346
|
? last.querySelector("." + actionsClass + " summary")
|
|
@@ -3177,10 +3351,9 @@ const dress = (c) => {
|
|
|
3177
3351
|
close.setAttribute("data-close-column", "");
|
|
3178
3352
|
if (col.querySelector("." + p + "-site-main")) {
|
|
3179
3353
|
action("copy", label("コンテンツをコピー", "Copy content"), () => {
|
|
3180
|
-
const content = col.querySelector("." + c.doc
|
|
3181
|
-
col.querySelector("." + c.doc);
|
|
3354
|
+
const content = col.querySelector("." + c.doc);
|
|
3182
3355
|
if (content)
|
|
3183
|
-
copy(content
|
|
3356
|
+
copy(markdownOf(content), label("コンテンツをコピーしました。", "Content copied."));
|
|
3184
3357
|
});
|
|
3185
3358
|
}
|
|
3186
3359
|
action("link", label("リンクをコピー", "Copy link"), () => copy(hrefFor(col), label("リンクをコピーしました。", "Link copied.")));
|
|
@@ -3241,7 +3414,7 @@ const dress = (c) => {
|
|
|
3241
3414
|
summary.setAttribute("aria-label", label(title + "の操作", "Actions for " + title));
|
|
3242
3415
|
const close = menu.querySelector("[data-close-column]");
|
|
3243
3416
|
if (close)
|
|
3244
|
-
close.hidden =
|
|
3417
|
+
close.hidden = index === 0;
|
|
3245
3418
|
if (open.length < 2)
|
|
3246
3419
|
return;
|
|
3247
3420
|
if (hrefFor(col) === home.href)
|
|
@@ -3264,10 +3437,60 @@ const dress = (c) => {
|
|
|
3264
3437
|
!document.documentElement.hasAttribute(c.min))
|
|
3265
3438
|
fold.click();
|
|
3266
3439
|
shownColumns = open.length;
|
|
3440
|
+
const first = open[0];
|
|
3441
|
+
if (sidebar && first) {
|
|
3442
|
+
const route = new URL(hrefFor(first))
|
|
3443
|
+
.pathname;
|
|
3444
|
+
for (const a of sidebar.querySelectorAll("." + p + "-nav a[href]")) {
|
|
3445
|
+
if (a.pathname === route &&
|
|
3446
|
+
!a.matches("." + p + "-shell-brand"))
|
|
3447
|
+
a.setAttribute("aria-current", "page");
|
|
3448
|
+
else
|
|
3449
|
+
a.removeAttribute("aria-current");
|
|
3450
|
+
}
|
|
3451
|
+
}
|
|
3267
3452
|
divider.hidden = crumbs.length === 0;
|
|
3268
3453
|
path.replaceChildren(...crumbs);
|
|
3269
3454
|
trail.scrollLeft = trail.scrollWidth;
|
|
3270
3455
|
};
|
|
3456
|
+
document.addEventListener("click", (event) => {
|
|
3457
|
+
const target = event.target;
|
|
3458
|
+
if (!(target instanceof Element) ||
|
|
3459
|
+
event.defaultPrevented ||
|
|
3460
|
+
event.button !== 0 ||
|
|
3461
|
+
event.metaKey ||
|
|
3462
|
+
event.ctrlKey ||
|
|
3463
|
+
event.shiftKey ||
|
|
3464
|
+
event.altKey)
|
|
3465
|
+
return;
|
|
3466
|
+
const link = target.closest("a");
|
|
3467
|
+
if (!(link instanceof HTMLAnchorElement))
|
|
3468
|
+
return;
|
|
3469
|
+
const hash = link.hash;
|
|
3470
|
+
const owner = link.closest("[" + c.column + "]");
|
|
3471
|
+
const here = link.pathname ===
|
|
3472
|
+
window.location.pathname ||
|
|
3473
|
+
(owner !== null &&
|
|
3474
|
+
new URL(hrefFor(owner)).pathname ===
|
|
3475
|
+
link.pathname);
|
|
3476
|
+
if (hash === "" || !here)
|
|
3477
|
+
return;
|
|
3478
|
+
const col = owner ?? document;
|
|
3479
|
+
const heading = col.querySelector("#" +
|
|
3480
|
+
CSS.escape(decodeURIComponent(hash.slice(1))));
|
|
3481
|
+
if (!heading)
|
|
3482
|
+
return;
|
|
3483
|
+
event.preventDefault();
|
|
3484
|
+
heading.scrollIntoView({
|
|
3485
|
+
behavior: window.matchMedia("(prefers-reduced-motion: reduce)").matches
|
|
3486
|
+
? "auto"
|
|
3487
|
+
: "smooth",
|
|
3488
|
+
block: "start",
|
|
3489
|
+
});
|
|
3490
|
+
window.history.replaceState(window.history.state, "", window.location.pathname +
|
|
3491
|
+
window.location.search +
|
|
3492
|
+
hash);
|
|
3493
|
+
});
|
|
3271
3494
|
document.addEventListener("click", (event) => {
|
|
3272
3495
|
const target = event.target;
|
|
3273
3496
|
for (const open of document.querySelectorAll("." + p + "-lang[open]")) {
|
|
@@ -3300,6 +3523,7 @@ const dress = (c) => {
|
|
|
3300
3523
|
subtree: true,
|
|
3301
3524
|
});
|
|
3302
3525
|
sync();
|
|
3526
|
+
window.requestAnimationFrame(() => window.requestAnimationFrame(() => shell.classList.add(p + "-doc-chrome-ready")));
|
|
3303
3527
|
};
|
|
3304
3528
|
const docChromeInitScript = (theme) => "(" +
|
|
3305
3529
|
dress.toString() +
|
|
@@ -3322,9 +3546,12 @@ const docChromeCss = (theme) => {
|
|
|
3322
3546
|
`${C} .${p}-shell-bar-brand{flex:none;border-radius:.4rem;padding:.08rem .4rem;background:transparent;color:${v("text")}}`,
|
|
3323
3547
|
`${C} .${p}-shell-side :is(.${p}-shell-head,.${p}-shell-foot){display:none}`,
|
|
3324
3548
|
`${C} .${p}-shell-side{border-right-color:transparent}`,
|
|
3549
|
+
`${C} .${p}-row{overscroll-behavior-x:auto}`,
|
|
3325
3550
|
`.${p}-sidebar-controls{display:flex;align-items:center;gap:.2rem;flex:none;margin-inline-start:auto}`,
|
|
3326
|
-
`${C} .${p}-sidebar-controls :is(.${p}-theme-toggle,.${p}-lang-toggle){width:2rem;height:2rem;margin:0;border:0;border-radius:.4rem;background:none}`,
|
|
3327
|
-
`${C} .${p}-sidebar-controls
|
|
3551
|
+
`${C} .${p}-sidebar-controls :is(.${p}-theme-toggle,.${p}-lang-toggle,.${p}-chrome-links a){display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;margin:0;padding:0;border:0;border-radius:.4rem;background:none;color:${v("text")};text-decoration:none;transition:background-color .15s}`,
|
|
3552
|
+
`${C} .${p}-sidebar-controls .${p}-chrome-links{display:flex;align-items:center;gap:.2rem;margin:0}`,
|
|
3553
|
+
`${C} .${p}-sidebar-controls .${p}-chrome-links a svg{display:block;width:18px;height:18px}`,
|
|
3554
|
+
`${C} .${p}-sidebar-controls :is(.${p}-theme-toggle,.${p}-lang-toggle,.${p}-chrome-links a):is(:hover,:focus-visible){background:${tint(7)};color:${v("text")}}`,
|
|
3328
3555
|
`@media (max-width:479px){${C} .${p}-shell-bar{gap:.25rem;padding-inline:.4rem}}`,
|
|
3329
3556
|
`${T}{display:grid;place-items:center;flex:none;width:2rem;height:2rem;padding:0;border:0;border-radius:.4rem;background:none;color:${v("text")};cursor:pointer}`,
|
|
3330
3557
|
`${T}:hover{background:${tint(7)}}`,
|
|
@@ -3337,13 +3564,15 @@ const docChromeCss = (theme) => {
|
|
|
3337
3564
|
`${T}[aria-expanded="true"] span::before{transform:rotate(45deg)}`,
|
|
3338
3565
|
`${T}[aria-expanded="true"] span::after{transform:rotate(-45deg)}`,
|
|
3339
3566
|
`@media (min-width:1024px){` +
|
|
3340
|
-
`${C}{transition:${inset} .28s cubic-bezier(.2,.7,.2,1)}` +
|
|
3567
|
+
`${C}.${p}-doc-chrome-ready{transition:${inset} .28s cubic-bezier(.2,.7,.2,1)}` +
|
|
3341
3568
|
`${C} .${p}-shell-side{overflow:hidden;transition:visibility 0s}` +
|
|
3342
3569
|
`${C} .${p}-shell-side .${p}-shell-body{min-width:16rem}` +
|
|
3343
3570
|
`${min} ${C},${C}${min}{${inset}:0px}` +
|
|
3344
3571
|
`${min} ${C} .${p}-shell-side{visibility:hidden;border-right-width:0;transition:visibility 0s .28s}` +
|
|
3345
3572
|
`${min} ${C} .${p}-shell-side .${p}-shell-body{display:block}` +
|
|
3346
|
-
`${C} .${p}-site-fill .${p}-site-main :is(.${p}-doc,.${p}-doc-foot):not(.${p}-doc *){margin-
|
|
3573
|
+
`${C} .${p}-site-fill .${p}-site-main :is(.${p}-doc,.${p}-doc-foot):not(.${p}-doc *){margin-left:0;margin-right:0;max-width:38em;box-sizing:content-box;padding-inline:0}` +
|
|
3574
|
+
`${C}.${p}-doc-chrome-ready .${p}-site-fill .${p}-site-main :is(.${p}-doc,.${p}-doc-foot):not(.${p}-doc *){transition:margin-left .28s cubic-bezier(.2,.7,.2,1)}` +
|
|
3575
|
+
`${min} ${C} .${p}-site-fill .${p}-site-main :is(.${p}-doc,.${p}-doc-foot):not(.${p}-doc *){margin-left:max(0px,calc((100% - 38em) / 2))}` +
|
|
3347
3576
|
`}`,
|
|
3348
3577
|
...shareCss_1.shareOptions.steps.map((step, i) => {
|
|
3349
3578
|
const below = i === 0
|
|
@@ -3382,10 +3611,10 @@ const docChromeCss = (theme) => {
|
|
|
3382
3611
|
`${A} button:hover{background:${tint(7)};color:${v("text")}}`,
|
|
3383
3612
|
`@media (pointer:coarse){${T},${A} summary{width:2.75rem;height:2.75rem}${A} button{min-height:2.75rem}}`,
|
|
3384
3613
|
`${C} .${p}-doc-foot{display:none}`,
|
|
3385
|
-
`.${p}-doc-shell-foot{flex:none;padding:.
|
|
3614
|
+
`.${p}-doc-shell-foot{flex:none;margin-top:auto;padding:.6rem 1.25rem;font-size:.75rem;line-height:1.4;color:${v("muted")};background:${v("surface")}}`,
|
|
3386
3615
|
`.${p}-doc-status{position:fixed;inset:auto 1rem 2.5rem auto;z-index:90;margin:0;border:1px solid ${v("primary-border")};border-radius:.4rem;padding:.55rem .85rem;background:${v("surface")};color:${v("text")}}`,
|
|
3387
3616
|
`.${p}-doc-status:empty{display:none}`,
|
|
3388
|
-
`@media (prefers-reduced-motion:reduce){${C},${T} span,${T} span::before,${T} span::after{transition:none}}`,
|
|
3617
|
+
`@media (prefers-reduced-motion:reduce){${C},${C} .${p}-site-main .${p}-doc,${T} span,${T} span::before,${T} span::after{transition:none}}`,
|
|
3389
3618
|
].join("\n");
|
|
3390
3619
|
};
|
|
3391
3620
|
exports.docChromeCss = docChromeCss;
|
|
@@ -8362,11 +8591,12 @@ ${(0, typesetting_1.typesetInkCss)(doc, {
|
|
|
8362
8591
|
mono: a.mono,
|
|
8363
8592
|
radius: a.radius,
|
|
8364
8593
|
})}
|
|
8365
|
-
${doc} a{color:${text};text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px;font-weight:400;padding:.08rem .25em;margin-inline:.05em;border-radius
|
|
8594
|
+
${doc} a{color:${text};text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px;font-weight:400;padding:.08rem .25em;margin-inline:.05em;border-radius:0;${quick("background-color", "color")}}
|
|
8366
8595
|
${doc} a:hover,${doc} a:focus-visible{${mark(a.press)};text-decoration:none;outline:0;box-decoration-break:clone;-webkit-box-decoration-break:clone}
|
|
8367
|
-
${doc} a[data-${p}-opened]{background:color-mix(in srgb,${text}
|
|
8596
|
+
${doc} a[data-${p}-opened]{background:color-mix(in srgb,${text} 82%,${surface});color:${surface};text-decoration:none}
|
|
8368
8597
|
${doc} a.${p}-docpager-link:is(:hover,:focus-visible){background:color-mix(in srgb,${text} 5%,transparent);color:${text}}
|
|
8369
|
-
${doc} a.${p}-docpager-link[data-${p}-opened]{background:color-mix(in srgb,${text}
|
|
8598
|
+
${doc} a.${p}-docpager-link[data-${p}-opened]{background:color-mix(in srgb,${text} 82%,${surface});color:${surface}}
|
|
8599
|
+
${doc} a.${p}-docpager-link[data-${p}-opened] *{color:inherit}
|
|
8370
8600
|
${doc} mark{${mark(a.current)};padding:.1em .25em;border-radius:${a.radius};box-decoration-break:clone;-webkit-box-decoration-break:clone;scroll-margin-top:1rem}
|
|
8371
8601
|
${doc} a:hover code,${doc} a:focus-visible code,${doc} a[data-${p}-opened] code{color:inherit;background:none;border-color:transparent}
|
|
8372
8602
|
.${p}-callout{margin:1.25rem 0;padding:.75rem 1rem;border:${a.ruleWidth} solid transparent;border-radius:${a.radius};font-size:.875rem;line-height:1.625}
|
package/dist/styleEntry.es.js
CHANGED
|
@@ -1657,7 +1657,7 @@ const link = `a.${classHooks_1.headingAnchorClass}`;
|
|
|
1657
1657
|
const heading = ":is(h1,h2,h3,h4,h5,h6)[id]";
|
|
1658
1658
|
const headingLink = `${heading} ${link}`;
|
|
1659
1659
|
exports.headingAnchorSystemCss = `${headingLink}{color:inherit;font:inherit;text-decoration:none;cursor:pointer}`;
|
|
1660
|
-
const headingAnchorAppearanceCss = (theme) => `${headingLink}{padding:.04em .3em;margin-inline:-.3em;border-radius
|
|
1660
|
+
const headingAnchorAppearanceCss = (theme) => `${headingLink}{padding:.04em .3em;margin-inline:-.3em;border-radius:0;background:none;color:${(0, Style_1.colorVar)(theme)("text")};text-decoration:none;box-decoration-break:clone;-webkit-box-decoration-break:clone}` +
|
|
1661
1661
|
`${headingLink}:is(:hover,:focus-visible){background:color-mix(in srgb,${(0, Style_1.colorVar)(theme)("text")} 7%,transparent);color:${(0, Style_1.colorVar)(theme)("text")};text-decoration:none;outline:0}`;
|
|
1662
1662
|
exports.headingAnchorAppearanceCss = headingAnchorAppearanceCss;
|
|
1663
1663
|
|
|
@@ -1697,23 +1697,28 @@ const docPager = (props) => (0, plgg_view_1.nav)([
|
|
|
1697
1697
|
exports.docPager = docPager;
|
|
1698
1698
|
const box = `.${classHooks_1.docPagerClass}`;
|
|
1699
1699
|
const item = `${box} a.${classHooks_1.docPagerLinkClass}`;
|
|
1700
|
-
exports.docPagerCss = `${box}{display:
|
|
1701
|
-
`
|
|
1702
|
-
`
|
|
1703
|
-
`${item}{display:flex;
|
|
1704
|
-
`
|
|
1705
|
-
`
|
|
1706
|
-
`color:${cvar("
|
|
1707
|
-
`${item}
|
|
1708
|
-
`${item}
|
|
1709
|
-
`
|
|
1710
|
-
|
|
1711
|
-
`
|
|
1712
|
-
|
|
1713
|
-
`
|
|
1714
|
-
|
|
1715
|
-
`
|
|
1716
|
-
|
|
1700
|
+
exports.docPagerCss = `${box}{display:flex;justify-content:space-between;` +
|
|
1701
|
+
`gap:1rem;margin-top:32px;padding-top:12px;` +
|
|
1702
|
+
`border-top:1px solid ${cvar("border")};max-width:46em}` +
|
|
1703
|
+
`${item}{display:inline-flex;align-items:center;` +
|
|
1704
|
+
`gap:.35rem;min-width:0;padding:.15rem .35rem;` +
|
|
1705
|
+
`margin-inline:-.35rem;text-decoration:none;` +
|
|
1706
|
+
`color:${cvar("muted")}}` +
|
|
1707
|
+
`${item}[data-dir="next"]{margin-left:auto}` +
|
|
1708
|
+
`${item}::before,${item}::after{flex:none;` +
|
|
1709
|
+
`width:.42rem;height:.42rem;` +
|
|
1710
|
+
`border-right:1.5px solid currentColor;` +
|
|
1711
|
+
`border-bottom:1.5px solid currentColor}` +
|
|
1712
|
+
`${item}[data-dir="prev"]::before{content:"";` +
|
|
1713
|
+
`transform:rotate(135deg)}` +
|
|
1714
|
+
`${item}[data-dir="next"]::after{content:"";` +
|
|
1715
|
+
`transform:rotate(-45deg)}` +
|
|
1716
|
+
`.${classHooks_1.docPagerDirClass}{position:absolute;width:1px;` +
|
|
1717
|
+
`height:1px;overflow:hidden;clip-path:inset(50%);` +
|
|
1718
|
+
`white-space:nowrap}` +
|
|
1719
|
+
`.${classHooks_1.docPagerTitleClass}{font-size:13px;` +
|
|
1720
|
+
`line-height:20px;font-weight:400;overflow:hidden;` +
|
|
1721
|
+
`text-overflow:ellipsis;white-space:nowrap}`;
|
|
1717
1722
|
|
|
1718
1723
|
},
|
|
1719
1724
|
"src/Component/usecase/hero.ts": function (module, exports, require) {
|
|
@@ -2372,8 +2377,9 @@ const dress = (c) => {
|
|
|
2372
2377
|
bar.append(controls);
|
|
2373
2378
|
drawerLabel.replaceWith(toggle);
|
|
2374
2379
|
for (const selector of [
|
|
2375
|
-
"." + p + "-
|
|
2380
|
+
"." + p + "-chrome-links",
|
|
2376
2381
|
"." + p + "-theme-toggle",
|
|
2382
|
+
"." + p + "-lang",
|
|
2377
2383
|
]) {
|
|
2378
2384
|
const control = bar.querySelector(selector);
|
|
2379
2385
|
if (control)
|
|
@@ -2434,7 +2440,10 @@ const dress = (c) => {
|
|
|
2434
2440
|
const foot = document.createElement("footer");
|
|
2435
2441
|
foot.className = p + "-doc-shell-foot";
|
|
2436
2442
|
foot.textContent = footText;
|
|
2437
|
-
|
|
2443
|
+
if (sidebar)
|
|
2444
|
+
sidebar.append(foot);
|
|
2445
|
+
else
|
|
2446
|
+
strip.after(foot);
|
|
2438
2447
|
}
|
|
2439
2448
|
const status = document.createElement("p");
|
|
2440
2449
|
status.className = p + "-doc-status";
|
|
@@ -2486,6 +2495,148 @@ const dress = (c) => {
|
|
|
2486
2495
|
.writeText(value)
|
|
2487
2496
|
.then(() => announce(done), fallback);
|
|
2488
2497
|
};
|
|
2498
|
+
const markdownOf = (root) => {
|
|
2499
|
+
const skip = (el) => el.matches("button,svg,script,style,template,input,select,textarea,[aria-hidden='true'],[hidden],." +
|
|
2500
|
+
p +
|
|
2501
|
+
"-example,." +
|
|
2502
|
+
p +
|
|
2503
|
+
"-docpager,." +
|
|
2504
|
+
c.doc +
|
|
2505
|
+
"-code-copy");
|
|
2506
|
+
const inline = (node) => {
|
|
2507
|
+
if (node.nodeType === Node.TEXT_NODE)
|
|
2508
|
+
return (node.textContent ?? "").replace(/\s+/g, " ");
|
|
2509
|
+
if (!(node instanceof Element) ||
|
|
2510
|
+
skip(node))
|
|
2511
|
+
return "";
|
|
2512
|
+
const inner = Array.from(node.childNodes)
|
|
2513
|
+
.map(inline)
|
|
2514
|
+
.join("");
|
|
2515
|
+
const tag = node.tagName.toLowerCase();
|
|
2516
|
+
if (tag === "code")
|
|
2517
|
+
return "`" + inner + "`";
|
|
2518
|
+
if (tag === "strong" || tag === "b")
|
|
2519
|
+
return inner.trim() === ""
|
|
2520
|
+
? ""
|
|
2521
|
+
: "**" + inner + "**";
|
|
2522
|
+
if (tag === "em" || tag === "i")
|
|
2523
|
+
return inner.trim() === ""
|
|
2524
|
+
? ""
|
|
2525
|
+
: "*" + inner + "*";
|
|
2526
|
+
if (tag === "br")
|
|
2527
|
+
return " \n";
|
|
2528
|
+
if (tag === "img")
|
|
2529
|
+
return (" +
|
|
2535
|
+
")");
|
|
2536
|
+
if (tag === "a" &&
|
|
2537
|
+
node instanceof HTMLAnchorElement) {
|
|
2538
|
+
const text = inner.trim();
|
|
2539
|
+
const href = node.href;
|
|
2540
|
+
return text === "" || href === ""
|
|
2541
|
+
? text
|
|
2542
|
+
: node.classList.contains(p + "-heading-anchor")
|
|
2543
|
+
? text
|
|
2544
|
+
: "[" + text + "](" + href + ")";
|
|
2545
|
+
}
|
|
2546
|
+
return inner;
|
|
2547
|
+
};
|
|
2548
|
+
const block = (node, depth) => {
|
|
2549
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
2550
|
+
const text = inline(node).trim();
|
|
2551
|
+
return text === "" ? "" : text + "\n\n";
|
|
2552
|
+
}
|
|
2553
|
+
if (!(node instanceof Element) ||
|
|
2554
|
+
skip(node))
|
|
2555
|
+
return "";
|
|
2556
|
+
const tag = node.tagName.toLowerCase();
|
|
2557
|
+
const heading = /^h([1-6])$/.exec(tag);
|
|
2558
|
+
if (heading)
|
|
2559
|
+
return ("#".repeat(Number(heading[1])) +
|
|
2560
|
+
" " +
|
|
2561
|
+
inline(node).trim() +
|
|
2562
|
+
"\n\n");
|
|
2563
|
+
if (tag === "p") {
|
|
2564
|
+
const text = inline(node).trim();
|
|
2565
|
+
return text === "" ? "" : text + "\n\n";
|
|
2566
|
+
}
|
|
2567
|
+
if (tag === "pre") {
|
|
2568
|
+
const code = node.querySelector("code");
|
|
2569
|
+
const lang = code
|
|
2570
|
+
? (/language-([\w-]+)/.exec(code.className)?.[1] ?? "")
|
|
2571
|
+
: "";
|
|
2572
|
+
const body = (code ?? node).textContent ?? "";
|
|
2573
|
+
return ("```" +
|
|
2574
|
+
lang +
|
|
2575
|
+
"\n" +
|
|
2576
|
+
body.replace(/\n$/, "") +
|
|
2577
|
+
"\n```\n\n");
|
|
2578
|
+
}
|
|
2579
|
+
if (tag === "ul" || tag === "ol") {
|
|
2580
|
+
const items = Array.from(node.children).filter((li) => li.tagName.toLowerCase() === "li");
|
|
2581
|
+
return (items
|
|
2582
|
+
.map((li, i) => {
|
|
2583
|
+
const mark = tag === "ol"
|
|
2584
|
+
? String(i + 1) + ". "
|
|
2585
|
+
: "- ";
|
|
2586
|
+
const own = Array.from(li.childNodes)
|
|
2587
|
+
.filter((n) => !(n instanceof Element &&
|
|
2588
|
+
/^(ul|ol)$/i.test(n.tagName)))
|
|
2589
|
+
.map(inline)
|
|
2590
|
+
.join("")
|
|
2591
|
+
.trim();
|
|
2592
|
+
const nested = Array.from(li.children)
|
|
2593
|
+
.filter((n) => /^(ul|ol)$/i.test(n.tagName))
|
|
2594
|
+
.map((n) => block(n, depth + 1))
|
|
2595
|
+
.join("");
|
|
2596
|
+
return (" ".repeat(depth) +
|
|
2597
|
+
mark +
|
|
2598
|
+
own +
|
|
2599
|
+
"\n" +
|
|
2600
|
+
nested.replace(/\n\n$/, "\n"));
|
|
2601
|
+
})
|
|
2602
|
+
.join("") + (depth === 0 ? "\n" : ""));
|
|
2603
|
+
}
|
|
2604
|
+
if (tag === "blockquote")
|
|
2605
|
+
return (Array.from(node.childNodes)
|
|
2606
|
+
.map((n) => block(n, depth))
|
|
2607
|
+
.join("")
|
|
2608
|
+
.trim()
|
|
2609
|
+
.split("\n")
|
|
2610
|
+
.map((line) => "> " + line)
|
|
2611
|
+
.join("\n") + "\n\n");
|
|
2612
|
+
if (tag === "hr")
|
|
2613
|
+
return "---\n\n";
|
|
2614
|
+
if (tag === "table") {
|
|
2615
|
+
const rows = Array.from(node.querySelectorAll("tr")).map((tr) => "| " +
|
|
2616
|
+
Array.from(tr.children)
|
|
2617
|
+
.map((cell) => inline(cell)
|
|
2618
|
+
.trim()
|
|
2619
|
+
.replace(/\|/g, "\\|"))
|
|
2620
|
+
.join(" | ") +
|
|
2621
|
+
" |");
|
|
2622
|
+
if (rows.length === 0)
|
|
2623
|
+
return "";
|
|
2624
|
+
const width = node.querySelector("tr")?.children
|
|
2625
|
+
.length ?? 1;
|
|
2626
|
+
return ([
|
|
2627
|
+
rows[0],
|
|
2628
|
+
"|" + " --- |".repeat(width),
|
|
2629
|
+
...rows.slice(1),
|
|
2630
|
+
].join("\n") + "\n\n");
|
|
2631
|
+
}
|
|
2632
|
+
return Array.from(node.childNodes)
|
|
2633
|
+
.map((n) => block(n, depth))
|
|
2634
|
+
.join("");
|
|
2635
|
+
};
|
|
2636
|
+
return (block(root, 0)
|
|
2637
|
+
.replace(/\n{3,}/g, "\n\n")
|
|
2638
|
+
.trim() + "\n");
|
|
2639
|
+
};
|
|
2489
2640
|
const addActions = (col, mount) => {
|
|
2490
2641
|
const menu = document.createElement("details");
|
|
2491
2642
|
menu.className = actionsClass;
|
|
@@ -2510,6 +2661,29 @@ const dress = (c) => {
|
|
|
2510
2661
|
const folder = col.querySelector("." + c.fold);
|
|
2511
2662
|
if (folder)
|
|
2512
2663
|
folder.click();
|
|
2664
|
+
else {
|
|
2665
|
+
const at = columns().indexOf(col);
|
|
2666
|
+
const params = new URLSearchParams(window.location.search);
|
|
2667
|
+
const rest = (params.get("c") ?? "")
|
|
2668
|
+
.split(",")
|
|
2669
|
+
.filter((entry) => entry !== "");
|
|
2670
|
+
if (at > 0 && at - 1 < rest.length) {
|
|
2671
|
+
rest.splice(at - 1, 1);
|
|
2672
|
+
if (rest.length === 0)
|
|
2673
|
+
params.delete("c");
|
|
2674
|
+
else
|
|
2675
|
+
params.set("c", rest.join(","));
|
|
2676
|
+
const query = params.toString();
|
|
2677
|
+
window.history.pushState(null, "", window.location.pathname +
|
|
2678
|
+
(query === ""
|
|
2679
|
+
? ""
|
|
2680
|
+
: "?" +
|
|
2681
|
+
query
|
|
2682
|
+
.replace(/%2F/gi, "/")
|
|
2683
|
+
.replace(/%2C/gi, ",")));
|
|
2684
|
+
window.dispatchEvent(new PopStateEvent("popstate"));
|
|
2685
|
+
}
|
|
2686
|
+
}
|
|
2513
2687
|
const last = columns().pop();
|
|
2514
2688
|
const next = last
|
|
2515
2689
|
? last.querySelector("." + actionsClass + " summary")
|
|
@@ -2520,10 +2694,9 @@ const dress = (c) => {
|
|
|
2520
2694
|
close.setAttribute("data-close-column", "");
|
|
2521
2695
|
if (col.querySelector("." + p + "-site-main")) {
|
|
2522
2696
|
action("copy", label("コンテンツをコピー", "Copy content"), () => {
|
|
2523
|
-
const content = col.querySelector("." + c.doc
|
|
2524
|
-
col.querySelector("." + c.doc);
|
|
2697
|
+
const content = col.querySelector("." + c.doc);
|
|
2525
2698
|
if (content)
|
|
2526
|
-
copy(content
|
|
2699
|
+
copy(markdownOf(content), label("コンテンツをコピーしました。", "Content copied."));
|
|
2527
2700
|
});
|
|
2528
2701
|
}
|
|
2529
2702
|
action("link", label("リンクをコピー", "Copy link"), () => copy(hrefFor(col), label("リンクをコピーしました。", "Link copied.")));
|
|
@@ -2584,7 +2757,7 @@ const dress = (c) => {
|
|
|
2584
2757
|
summary.setAttribute("aria-label", label(title + "の操作", "Actions for " + title));
|
|
2585
2758
|
const close = menu.querySelector("[data-close-column]");
|
|
2586
2759
|
if (close)
|
|
2587
|
-
close.hidden =
|
|
2760
|
+
close.hidden = index === 0;
|
|
2588
2761
|
if (open.length < 2)
|
|
2589
2762
|
return;
|
|
2590
2763
|
if (hrefFor(col) === home.href)
|
|
@@ -2607,10 +2780,60 @@ const dress = (c) => {
|
|
|
2607
2780
|
!document.documentElement.hasAttribute(c.min))
|
|
2608
2781
|
fold.click();
|
|
2609
2782
|
shownColumns = open.length;
|
|
2783
|
+
const first = open[0];
|
|
2784
|
+
if (sidebar && first) {
|
|
2785
|
+
const route = new URL(hrefFor(first))
|
|
2786
|
+
.pathname;
|
|
2787
|
+
for (const a of sidebar.querySelectorAll("." + p + "-nav a[href]")) {
|
|
2788
|
+
if (a.pathname === route &&
|
|
2789
|
+
!a.matches("." + p + "-shell-brand"))
|
|
2790
|
+
a.setAttribute("aria-current", "page");
|
|
2791
|
+
else
|
|
2792
|
+
a.removeAttribute("aria-current");
|
|
2793
|
+
}
|
|
2794
|
+
}
|
|
2610
2795
|
divider.hidden = crumbs.length === 0;
|
|
2611
2796
|
path.replaceChildren(...crumbs);
|
|
2612
2797
|
trail.scrollLeft = trail.scrollWidth;
|
|
2613
2798
|
};
|
|
2799
|
+
document.addEventListener("click", (event) => {
|
|
2800
|
+
const target = event.target;
|
|
2801
|
+
if (!(target instanceof Element) ||
|
|
2802
|
+
event.defaultPrevented ||
|
|
2803
|
+
event.button !== 0 ||
|
|
2804
|
+
event.metaKey ||
|
|
2805
|
+
event.ctrlKey ||
|
|
2806
|
+
event.shiftKey ||
|
|
2807
|
+
event.altKey)
|
|
2808
|
+
return;
|
|
2809
|
+
const link = target.closest("a");
|
|
2810
|
+
if (!(link instanceof HTMLAnchorElement))
|
|
2811
|
+
return;
|
|
2812
|
+
const hash = link.hash;
|
|
2813
|
+
const owner = link.closest("[" + c.column + "]");
|
|
2814
|
+
const here = link.pathname ===
|
|
2815
|
+
window.location.pathname ||
|
|
2816
|
+
(owner !== null &&
|
|
2817
|
+
new URL(hrefFor(owner)).pathname ===
|
|
2818
|
+
link.pathname);
|
|
2819
|
+
if (hash === "" || !here)
|
|
2820
|
+
return;
|
|
2821
|
+
const col = owner ?? document;
|
|
2822
|
+
const heading = col.querySelector("#" +
|
|
2823
|
+
CSS.escape(decodeURIComponent(hash.slice(1))));
|
|
2824
|
+
if (!heading)
|
|
2825
|
+
return;
|
|
2826
|
+
event.preventDefault();
|
|
2827
|
+
heading.scrollIntoView({
|
|
2828
|
+
behavior: window.matchMedia("(prefers-reduced-motion: reduce)").matches
|
|
2829
|
+
? "auto"
|
|
2830
|
+
: "smooth",
|
|
2831
|
+
block: "start",
|
|
2832
|
+
});
|
|
2833
|
+
window.history.replaceState(window.history.state, "", window.location.pathname +
|
|
2834
|
+
window.location.search +
|
|
2835
|
+
hash);
|
|
2836
|
+
});
|
|
2614
2837
|
document.addEventListener("click", (event) => {
|
|
2615
2838
|
const target = event.target;
|
|
2616
2839
|
for (const open of document.querySelectorAll("." + p + "-lang[open]")) {
|
|
@@ -2643,6 +2866,7 @@ const dress = (c) => {
|
|
|
2643
2866
|
subtree: true,
|
|
2644
2867
|
});
|
|
2645
2868
|
sync();
|
|
2869
|
+
window.requestAnimationFrame(() => window.requestAnimationFrame(() => shell.classList.add(p + "-doc-chrome-ready")));
|
|
2646
2870
|
};
|
|
2647
2871
|
const docChromeInitScript = (theme) => "(" +
|
|
2648
2872
|
dress.toString() +
|
|
@@ -2665,9 +2889,12 @@ const docChromeCss = (theme) => {
|
|
|
2665
2889
|
`${C} .${p}-shell-bar-brand{flex:none;border-radius:.4rem;padding:.08rem .4rem;background:transparent;color:${v("text")}}`,
|
|
2666
2890
|
`${C} .${p}-shell-side :is(.${p}-shell-head,.${p}-shell-foot){display:none}`,
|
|
2667
2891
|
`${C} .${p}-shell-side{border-right-color:transparent}`,
|
|
2892
|
+
`${C} .${p}-row{overscroll-behavior-x:auto}`,
|
|
2668
2893
|
`.${p}-sidebar-controls{display:flex;align-items:center;gap:.2rem;flex:none;margin-inline-start:auto}`,
|
|
2669
|
-
`${C} .${p}-sidebar-controls :is(.${p}-theme-toggle,.${p}-lang-toggle){width:2rem;height:2rem;margin:0;border:0;border-radius:.4rem;background:none}`,
|
|
2670
|
-
`${C} .${p}-sidebar-controls
|
|
2894
|
+
`${C} .${p}-sidebar-controls :is(.${p}-theme-toggle,.${p}-lang-toggle,.${p}-chrome-links a){display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;margin:0;padding:0;border:0;border-radius:.4rem;background:none;color:${v("text")};text-decoration:none;transition:background-color .15s}`,
|
|
2895
|
+
`${C} .${p}-sidebar-controls .${p}-chrome-links{display:flex;align-items:center;gap:.2rem;margin:0}`,
|
|
2896
|
+
`${C} .${p}-sidebar-controls .${p}-chrome-links a svg{display:block;width:18px;height:18px}`,
|
|
2897
|
+
`${C} .${p}-sidebar-controls :is(.${p}-theme-toggle,.${p}-lang-toggle,.${p}-chrome-links a):is(:hover,:focus-visible){background:${tint(7)};color:${v("text")}}`,
|
|
2671
2898
|
`@media (max-width:479px){${C} .${p}-shell-bar{gap:.25rem;padding-inline:.4rem}}`,
|
|
2672
2899
|
`${T}{display:grid;place-items:center;flex:none;width:2rem;height:2rem;padding:0;border:0;border-radius:.4rem;background:none;color:${v("text")};cursor:pointer}`,
|
|
2673
2900
|
`${T}:hover{background:${tint(7)}}`,
|
|
@@ -2680,13 +2907,15 @@ const docChromeCss = (theme) => {
|
|
|
2680
2907
|
`${T}[aria-expanded="true"] span::before{transform:rotate(45deg)}`,
|
|
2681
2908
|
`${T}[aria-expanded="true"] span::after{transform:rotate(-45deg)}`,
|
|
2682
2909
|
`@media (min-width:1024px){` +
|
|
2683
|
-
`${C}{transition:${inset} .28s cubic-bezier(.2,.7,.2,1)}` +
|
|
2910
|
+
`${C}.${p}-doc-chrome-ready{transition:${inset} .28s cubic-bezier(.2,.7,.2,1)}` +
|
|
2684
2911
|
`${C} .${p}-shell-side{overflow:hidden;transition:visibility 0s}` +
|
|
2685
2912
|
`${C} .${p}-shell-side .${p}-shell-body{min-width:16rem}` +
|
|
2686
2913
|
`${min} ${C},${C}${min}{${inset}:0px}` +
|
|
2687
2914
|
`${min} ${C} .${p}-shell-side{visibility:hidden;border-right-width:0;transition:visibility 0s .28s}` +
|
|
2688
2915
|
`${min} ${C} .${p}-shell-side .${p}-shell-body{display:block}` +
|
|
2689
|
-
`${C} .${p}-site-fill .${p}-site-main :is(.${p}-doc,.${p}-doc-foot):not(.${p}-doc *){margin-
|
|
2916
|
+
`${C} .${p}-site-fill .${p}-site-main :is(.${p}-doc,.${p}-doc-foot):not(.${p}-doc *){margin-left:0;margin-right:0;max-width:38em;box-sizing:content-box;padding-inline:0}` +
|
|
2917
|
+
`${C}.${p}-doc-chrome-ready .${p}-site-fill .${p}-site-main :is(.${p}-doc,.${p}-doc-foot):not(.${p}-doc *){transition:margin-left .28s cubic-bezier(.2,.7,.2,1)}` +
|
|
2918
|
+
`${min} ${C} .${p}-site-fill .${p}-site-main :is(.${p}-doc,.${p}-doc-foot):not(.${p}-doc *){margin-left:max(0px,calc((100% - 38em) / 2))}` +
|
|
2690
2919
|
`}`,
|
|
2691
2920
|
...shareCss_1.shareOptions.steps.map((step, i) => {
|
|
2692
2921
|
const below = i === 0
|
|
@@ -2725,10 +2954,10 @@ const docChromeCss = (theme) => {
|
|
|
2725
2954
|
`${A} button:hover{background:${tint(7)};color:${v("text")}}`,
|
|
2726
2955
|
`@media (pointer:coarse){${T},${A} summary{width:2.75rem;height:2.75rem}${A} button{min-height:2.75rem}}`,
|
|
2727
2956
|
`${C} .${p}-doc-foot{display:none}`,
|
|
2728
|
-
`.${p}-doc-shell-foot{flex:none;padding:.
|
|
2957
|
+
`.${p}-doc-shell-foot{flex:none;margin-top:auto;padding:.6rem 1.25rem;font-size:.75rem;line-height:1.4;color:${v("muted")};background:${v("surface")}}`,
|
|
2729
2958
|
`.${p}-doc-status{position:fixed;inset:auto 1rem 2.5rem auto;z-index:90;margin:0;border:1px solid ${v("primary-border")};border-radius:.4rem;padding:.55rem .85rem;background:${v("surface")};color:${v("text")}}`,
|
|
2730
2959
|
`.${p}-doc-status:empty{display:none}`,
|
|
2731
|
-
`@media (prefers-reduced-motion:reduce){${C},${T} span,${T} span::before,${T} span::after{transition:none}}`,
|
|
2960
|
+
`@media (prefers-reduced-motion:reduce){${C},${C} .${p}-site-main .${p}-doc,${T} span,${T} span::before,${T} span::after{transition:none}}`,
|
|
2732
2961
|
].join("\n");
|
|
2733
2962
|
};
|
|
2734
2963
|
exports.docChromeCss = docChromeCss;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plggmatic",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.15",
|
|
4
4
|
"description": "A column-oriented UI design framework on the plgg family: pane alignment, a typed light/dark color scheme, and fundamental components as pure functions returning plgg-view Html",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.es.js",
|