plggmatic 0.5.12 → 0.5.14
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/Component/usecase/languageMenu.d.ts.map +1 -1
- package/dist/Shell/usecase/docChrome.d.ts +1 -1
- package/dist/Shell/usecase/docChrome.d.ts.map +1 -1
- package/dist/index.es.js +311 -66
- package/dist/styleEntry.es.js +307 -63
- 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":"languageMenu.d.ts","sourceRoot":"","sources":["../../../src/Component/usecase/languageMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,KAAK,IAAI,EAWV,MAAM,WAAW,CAAC;AAWnB;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IACpC,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACvC,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IACvC,KAAK,EAAE,IAAI,GAAG,MAAM,CAAC;CACtB,CAAC,CAAC;AAgDH;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,UAChB,iBAAiB,KACvB,IAAI,CAAC,KAAK,EAAE,SAAS,CAsBrB,CAAC;AAEJ,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,GACpB,CAAC;AAOF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"languageMenu.d.ts","sourceRoot":"","sources":["../../../src/Component/usecase/languageMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,KAAK,IAAI,EAWV,MAAM,WAAW,CAAC;AAWnB;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IACpC,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACvC,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IACvC,KAAK,EAAE,IAAI,GAAG,MAAM,CAAC;CACtB,CAAC,CAAC;AAgDH;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,UAChB,iBAAiB,KACvB,IAAI,CAAC,KAAK,EAAE,SAAS,CAsBrB,CAAC;AAEJ,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,GACpB,CAAC;AAOF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,OA6B0D,CAAC"}
|
|
@@ -7,7 +7,7 @@ import { type Theme } from "../../Style";
|
|
|
7
7
|
* all, and the columns take the whole width, sliding as
|
|
8
8
|
* it moves); the header carries breadcrumbs of the open
|
|
9
9
|
* pages, each scrolling its column to the left edge; the
|
|
10
|
-
*
|
|
10
|
+
* header's right end holds the language and theme controls;
|
|
11
11
|
* every open column gets a three-dot menu (close the
|
|
12
12
|
* column, copy its content, copy its link); a lone page
|
|
13
13
|
* with the sidebar shut is centred at the prose measure.
|
|
@@ -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
|
@@ -2313,33 +2313,33 @@ const list = `.${classHooks_1.languageListClass}`;
|
|
|
2313
2313
|
const item = `.${classHooks_1.languageOptionClass}`;
|
|
2314
2314
|
exports.languageMenuCss = `${menu}{position:relative;display:inline-flex}` +
|
|
2315
2315
|
`${toggle}{display:inline-flex;align-items:center;` +
|
|
2316
|
-
`justify-content:center;width:
|
|
2317
|
-
`border-radius:
|
|
2318
|
-
`
|
|
2319
|
-
`
|
|
2320
|
-
`transition:border-color 0.15s}` +
|
|
2316
|
+
`justify-content:center;width:2rem;height:2rem;` +
|
|
2317
|
+
`border:0;border-radius:.4rem;background:none;` +
|
|
2318
|
+
`color:${cvar("text")};cursor:pointer;list-style:none;` +
|
|
2319
|
+
`transition:background-color .15s}` +
|
|
2321
2320
|
`${toggle}::-webkit-details-marker{display:none}` +
|
|
2322
|
-
`${toggle}:hover{
|
|
2323
|
-
`${toggle}:focus-visible{outline:
|
|
2324
|
-
`${cvar("
|
|
2321
|
+
`${toggle}:hover,${menu}[open] ${toggle}{background:color-mix(in srgb,${cvar("text")} 7%,transparent)}` +
|
|
2322
|
+
`${toggle}:focus-visible{outline:1.5px solid ` +
|
|
2323
|
+
`${cvar("text")};outline-offset:2px}` +
|
|
2325
2324
|
`${toggle} svg{display:block;width:18px;height:18px}` +
|
|
2326
2325
|
`${list}{position:absolute;z-index:60;` +
|
|
2327
|
-
`min-width:
|
|
2328
|
-
`flex-direction:column;gap:0
|
|
2326
|
+
`min-width:max-content;padding:.2rem;display:flex;` +
|
|
2327
|
+
`flex-direction:column;gap:0;` +
|
|
2329
2328
|
`background:${cvar("surface")};` +
|
|
2330
|
-
`border:1px solid ${cvar("border")}
|
|
2329
|
+
`border:1px solid ${cvar("border")};border-radius:.4rem;` +
|
|
2330
|
+
`box-shadow:0 .2rem .65rem color-mix(in srgb,${cvar("text")} 12%,transparent)}` +
|
|
2331
2331
|
`${menu}[data-opens="down"] ${list}{` +
|
|
2332
|
-
`top:calc(100% +
|
|
2332
|
+
`top:calc(100% + 4px);right:0}` +
|
|
2333
2333
|
`${menu}[data-opens="up"] ${list}{` +
|
|
2334
|
-
`bottom:calc(100% +
|
|
2335
|
-
`${item}{display:block;padding
|
|
2336
|
-
`font-size
|
|
2334
|
+
`bottom:calc(100% + 4px);left:0}` +
|
|
2335
|
+
`${item}{display:block;padding:.3rem .6rem;` +
|
|
2336
|
+
`border-radius:.4rem;font-size:.8125rem;line-height:1.35;` +
|
|
2337
2337
|
`white-space:nowrap;color:${cvar("text")};` +
|
|
2338
2338
|
`text-decoration:none}` +
|
|
2339
2339
|
`${item}:hover,${item}:focus-visible{` +
|
|
2340
|
-
`background
|
|
2341
|
-
`color:${cvar("
|
|
2342
|
-
`${item}[aria-current]{
|
|
2340
|
+
`background:color-mix(in srgb,${cvar("text")} 7%,transparent);` +
|
|
2341
|
+
`color:${cvar("text")};outline:0}` +
|
|
2342
|
+
`${item}[aria-current]{background:color-mix(in srgb,${cvar("text")} 12%,transparent)}`;
|
|
2343
2343
|
|
|
2344
2344
|
},
|
|
2345
2345
|
"src/Component/usecase/headingAnchor.ts": function (module, exports, require) {
|
|
@@ -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) {
|
|
@@ -3026,9 +3031,10 @@ const dress = (c) => {
|
|
|
3026
3031
|
controls.className = p + "-sidebar-controls";
|
|
3027
3032
|
controls.setAttribute("role", "group");
|
|
3028
3033
|
controls.setAttribute("aria-label", label("表示設定", "Display settings"));
|
|
3029
|
-
|
|
3034
|
+
bar.append(controls);
|
|
3030
3035
|
drawerLabel.replaceWith(toggle);
|
|
3031
3036
|
for (const selector of [
|
|
3037
|
+
"." + p + "-chrome-links",
|
|
3032
3038
|
"." + p + "-lang",
|
|
3033
3039
|
"." + p + "-theme-toggle",
|
|
3034
3040
|
]) {
|
|
@@ -3038,7 +3044,7 @@ const dress = (c) => {
|
|
|
3038
3044
|
}
|
|
3039
3045
|
const language = controls.querySelector("." + p + "-lang");
|
|
3040
3046
|
if (language)
|
|
3041
|
-
language.setAttribute("data-opens", "
|
|
3047
|
+
language.setAttribute("data-opens", "down");
|
|
3042
3048
|
const sync = () => {
|
|
3043
3049
|
const expanded = desktop.matches
|
|
3044
3050
|
? !document.documentElement.hasAttribute(c.min)
|
|
@@ -3083,6 +3089,19 @@ const dress = (c) => {
|
|
|
3083
3089
|
divider.setAttribute("aria-hidden", "true");
|
|
3084
3090
|
divider.textContent = "›";
|
|
3085
3091
|
home.after(divider, trail);
|
|
3092
|
+
const pageFoot = shell.querySelector("." + p + "-doc-foot");
|
|
3093
|
+
const footText = pageFoot && pageFoot.textContent
|
|
3094
|
+
? pageFoot.textContent.trim()
|
|
3095
|
+
: "";
|
|
3096
|
+
if (footText !== "") {
|
|
3097
|
+
const foot = document.createElement("footer");
|
|
3098
|
+
foot.className = p + "-doc-shell-foot";
|
|
3099
|
+
foot.textContent = footText;
|
|
3100
|
+
if (sidebar)
|
|
3101
|
+
sidebar.append(foot);
|
|
3102
|
+
else
|
|
3103
|
+
strip.after(foot);
|
|
3104
|
+
}
|
|
3086
3105
|
const status = document.createElement("p");
|
|
3087
3106
|
status.className = p + "-doc-status";
|
|
3088
3107
|
status.setAttribute("role", "status");
|
|
@@ -3133,6 +3152,148 @@ const dress = (c) => {
|
|
|
3133
3152
|
.writeText(value)
|
|
3134
3153
|
.then(() => announce(done), fallback);
|
|
3135
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
|
+
};
|
|
3136
3297
|
const addActions = (col, mount) => {
|
|
3137
3298
|
const menu = document.createElement("details");
|
|
3138
3299
|
menu.className = actionsClass;
|
|
@@ -3157,6 +3318,29 @@ const dress = (c) => {
|
|
|
3157
3318
|
const folder = col.querySelector("." + c.fold);
|
|
3158
3319
|
if (folder)
|
|
3159
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
|
+
}
|
|
3160
3344
|
const last = columns().pop();
|
|
3161
3345
|
const next = last
|
|
3162
3346
|
? last.querySelector("." + actionsClass + " summary")
|
|
@@ -3167,10 +3351,9 @@ const dress = (c) => {
|
|
|
3167
3351
|
close.setAttribute("data-close-column", "");
|
|
3168
3352
|
if (col.querySelector("." + p + "-site-main")) {
|
|
3169
3353
|
action("copy", label("コンテンツをコピー", "Copy content"), () => {
|
|
3170
|
-
const content = col.querySelector("." + c.doc
|
|
3171
|
-
col.querySelector("." + c.doc);
|
|
3354
|
+
const content = col.querySelector("." + c.doc);
|
|
3172
3355
|
if (content)
|
|
3173
|
-
copy(content
|
|
3356
|
+
copy(markdownOf(content), label("コンテンツをコピーしました。", "Content copied."));
|
|
3174
3357
|
});
|
|
3175
3358
|
}
|
|
3176
3359
|
action("link", label("リンクをコピー", "Copy link"), () => copy(hrefFor(col), label("リンクをコピーしました。", "Link copied.")));
|
|
@@ -3208,17 +3391,7 @@ const dress = (c) => {
|
|
|
3208
3391
|
});
|
|
3209
3392
|
};
|
|
3210
3393
|
let shownColumns = 0;
|
|
3211
|
-
let homeColumn = null;
|
|
3212
|
-
home.addEventListener("click", (event) => {
|
|
3213
|
-
if (homeColumn &&
|
|
3214
|
-
homeColumn.isConnected &&
|
|
3215
|
-
columns().length > 1) {
|
|
3216
|
-
event.preventDefault();
|
|
3217
|
-
bring(homeColumn);
|
|
3218
|
-
}
|
|
3219
|
-
});
|
|
3220
3394
|
const sync = () => {
|
|
3221
|
-
homeColumn = null;
|
|
3222
3395
|
room.style.width = "0px";
|
|
3223
3396
|
const open = columns();
|
|
3224
3397
|
const crumbs = [];
|
|
@@ -3241,13 +3414,11 @@ 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
|
-
if (hrefFor(col) === home.href)
|
|
3248
|
-
homeColumn = col;
|
|
3420
|
+
if (hrefFor(col) === home.href)
|
|
3249
3421
|
return;
|
|
3250
|
-
}
|
|
3251
3422
|
const item = document.createElement("li");
|
|
3252
3423
|
const button = document.createElement("button");
|
|
3253
3424
|
button.type = "button";
|
|
@@ -3266,10 +3437,74 @@ const dress = (c) => {
|
|
|
3266
3437
|
!document.documentElement.hasAttribute(c.min))
|
|
3267
3438
|
fold.click();
|
|
3268
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
|
+
}
|
|
3269
3452
|
divider.hidden = crumbs.length === 0;
|
|
3270
3453
|
path.replaceChildren(...crumbs);
|
|
3271
3454
|
trail.scrollLeft = trail.scrollWidth;
|
|
3272
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
|
+
});
|
|
3494
|
+
document.addEventListener("click", (event) => {
|
|
3495
|
+
const target = event.target;
|
|
3496
|
+
for (const open of document.querySelectorAll("." + p + "-lang[open]")) {
|
|
3497
|
+
if (!(target instanceof Node) ||
|
|
3498
|
+
!open.contains(target))
|
|
3499
|
+
open.open = false;
|
|
3500
|
+
}
|
|
3501
|
+
});
|
|
3502
|
+
document.addEventListener("keydown", (event) => {
|
|
3503
|
+
if (event.key !== "Escape")
|
|
3504
|
+
return;
|
|
3505
|
+
for (const open of document.querySelectorAll("." + p + "-lang[open]"))
|
|
3506
|
+
open.open = false;
|
|
3507
|
+
});
|
|
3273
3508
|
document.addEventListener("click", (event) => {
|
|
3274
3509
|
const target = event.target;
|
|
3275
3510
|
for (const menu of strip.querySelectorAll("." + actionsClass + "[open]")) {
|
|
@@ -3288,6 +3523,7 @@ const dress = (c) => {
|
|
|
3288
3523
|
subtree: true,
|
|
3289
3524
|
});
|
|
3290
3525
|
sync();
|
|
3526
|
+
window.requestAnimationFrame(() => window.requestAnimationFrame(() => shell.classList.add(p + "-doc-chrome-ready")));
|
|
3291
3527
|
};
|
|
3292
3528
|
const docChromeInitScript = (theme) => "(" +
|
|
3293
3529
|
dress.toString() +
|
|
@@ -3309,9 +3545,13 @@ const docChromeCss = (theme) => {
|
|
|
3309
3545
|
`html:not([${marker_1.embeddedAttr}]) ${C} .${p}-shell-bar{display:flex}`,
|
|
3310
3546
|
`${C} .${p}-shell-bar-brand{flex:none;border-radius:.4rem;padding:.08rem .4rem;background:transparent;color:${v("text")}}`,
|
|
3311
3547
|
`${C} .${p}-shell-side :is(.${p}-shell-head,.${p}-shell-foot){display:none}`,
|
|
3312
|
-
|
|
3313
|
-
`${C} .${p}-
|
|
3314
|
-
|
|
3548
|
+
`${C} .${p}-shell-side{border-right-color:transparent}`,
|
|
3549
|
+
`${C} .${p}-row{overscroll-behavior-x:auto}`,
|
|
3550
|
+
`.${p}-sidebar-controls{display:flex;align-items:center;gap:.2rem;flex:none;margin-inline-start:auto}`,
|
|
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")}}`,
|
|
3315
3555
|
`@media (max-width:479px){${C} .${p}-shell-bar{gap:.25rem;padding-inline:.4rem}}`,
|
|
3316
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}`,
|
|
3317
3557
|
`${T}:hover{background:${tint(7)}}`,
|
|
@@ -3324,13 +3564,15 @@ const docChromeCss = (theme) => {
|
|
|
3324
3564
|
`${T}[aria-expanded="true"] span::before{transform:rotate(45deg)}`,
|
|
3325
3565
|
`${T}[aria-expanded="true"] span::after{transform:rotate(-45deg)}`,
|
|
3326
3566
|
`@media (min-width:1024px){` +
|
|
3327
|
-
`${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)}` +
|
|
3328
3568
|
`${C} .${p}-shell-side{overflow:hidden;transition:visibility 0s}` +
|
|
3329
|
-
`${C} .${p}-shell-side
|
|
3569
|
+
`${C} .${p}-shell-side .${p}-shell-body{min-width:16rem}` +
|
|
3330
3570
|
`${min} ${C},${C}${min}{${inset}:0px}` +
|
|
3331
3571
|
`${min} ${C} .${p}-shell-side{visibility:hidden;border-right-width:0;transition:visibility 0s .28s}` +
|
|
3332
3572
|
`${min} ${C} .${p}-shell-side .${p}-shell-body{display:block}` +
|
|
3333
|
-
`${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))}` +
|
|
3334
3576
|
`}`,
|
|
3335
3577
|
...shareCss_1.shareOptions.steps.map((step, i) => {
|
|
3336
3578
|
const below = i === 0
|
|
@@ -3368,9 +3610,11 @@ const docChromeCss = (theme) => {
|
|
|
3368
3610
|
`${A} button[hidden]{display:none}`,
|
|
3369
3611
|
`${A} button:hover{background:${tint(7)};color:${v("text")}}`,
|
|
3370
3612
|
`@media (pointer:coarse){${T},${A} summary{width:2.75rem;height:2.75rem}${A} button{min-height:2.75rem}}`,
|
|
3371
|
-
|
|
3613
|
+
`${C} .${p}-doc-foot{display:none}`,
|
|
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")}}`,
|
|
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")}}`,
|
|
3372
3616
|
`.${p}-doc-status:empty{display:none}`,
|
|
3373
|
-
`@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}}`,
|
|
3374
3618
|
].join("\n");
|
|
3375
3619
|
};
|
|
3376
3620
|
exports.docChromeCss = docChromeCss;
|
|
@@ -8347,11 +8591,12 @@ ${(0, typesetting_1.typesetInkCss)(doc, {
|
|
|
8347
8591
|
mono: a.mono,
|
|
8348
8592
|
radius: a.radius,
|
|
8349
8593
|
})}
|
|
8350
|
-
${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")}}
|
|
8351
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}
|
|
8352
|
-
${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}
|
|
8353
8597
|
${doc} a.${p}-docpager-link:is(:hover,:focus-visible){background:color-mix(in srgb,${text} 5%,transparent);color:${text}}
|
|
8354
|
-
${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}
|
|
8355
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}
|
|
8356
8601
|
${doc} a:hover code,${doc} a:focus-visible code,${doc} a[data-${p}-opened] code{color:inherit;background:none;border-color:transparent}
|
|
8357
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
|
@@ -1611,33 +1611,33 @@ const list = `.${classHooks_1.languageListClass}`;
|
|
|
1611
1611
|
const item = `.${classHooks_1.languageOptionClass}`;
|
|
1612
1612
|
exports.languageMenuCss = `${menu}{position:relative;display:inline-flex}` +
|
|
1613
1613
|
`${toggle}{display:inline-flex;align-items:center;` +
|
|
1614
|
-
`justify-content:center;width:
|
|
1615
|
-
`border-radius:
|
|
1616
|
-
`
|
|
1617
|
-
`
|
|
1618
|
-
`transition:border-color 0.15s}` +
|
|
1614
|
+
`justify-content:center;width:2rem;height:2rem;` +
|
|
1615
|
+
`border:0;border-radius:.4rem;background:none;` +
|
|
1616
|
+
`color:${cvar("text")};cursor:pointer;list-style:none;` +
|
|
1617
|
+
`transition:background-color .15s}` +
|
|
1619
1618
|
`${toggle}::-webkit-details-marker{display:none}` +
|
|
1620
|
-
`${toggle}:hover{
|
|
1621
|
-
`${toggle}:focus-visible{outline:
|
|
1622
|
-
`${cvar("
|
|
1619
|
+
`${toggle}:hover,${menu}[open] ${toggle}{background:color-mix(in srgb,${cvar("text")} 7%,transparent)}` +
|
|
1620
|
+
`${toggle}:focus-visible{outline:1.5px solid ` +
|
|
1621
|
+
`${cvar("text")};outline-offset:2px}` +
|
|
1623
1622
|
`${toggle} svg{display:block;width:18px;height:18px}` +
|
|
1624
1623
|
`${list}{position:absolute;z-index:60;` +
|
|
1625
|
-
`min-width:
|
|
1626
|
-
`flex-direction:column;gap:0
|
|
1624
|
+
`min-width:max-content;padding:.2rem;display:flex;` +
|
|
1625
|
+
`flex-direction:column;gap:0;` +
|
|
1627
1626
|
`background:${cvar("surface")};` +
|
|
1628
|
-
`border:1px solid ${cvar("border")}
|
|
1627
|
+
`border:1px solid ${cvar("border")};border-radius:.4rem;` +
|
|
1628
|
+
`box-shadow:0 .2rem .65rem color-mix(in srgb,${cvar("text")} 12%,transparent)}` +
|
|
1629
1629
|
`${menu}[data-opens="down"] ${list}{` +
|
|
1630
|
-
`top:calc(100% +
|
|
1630
|
+
`top:calc(100% + 4px);right:0}` +
|
|
1631
1631
|
`${menu}[data-opens="up"] ${list}{` +
|
|
1632
|
-
`bottom:calc(100% +
|
|
1633
|
-
`${item}{display:block;padding
|
|
1634
|
-
`font-size
|
|
1632
|
+
`bottom:calc(100% + 4px);left:0}` +
|
|
1633
|
+
`${item}{display:block;padding:.3rem .6rem;` +
|
|
1634
|
+
`border-radius:.4rem;font-size:.8125rem;line-height:1.35;` +
|
|
1635
1635
|
`white-space:nowrap;color:${cvar("text")};` +
|
|
1636
1636
|
`text-decoration:none}` +
|
|
1637
1637
|
`${item}:hover,${item}:focus-visible{` +
|
|
1638
|
-
`background
|
|
1639
|
-
`color:${cvar("
|
|
1640
|
-
`${item}[aria-current]{
|
|
1638
|
+
`background:color-mix(in srgb,${cvar("text")} 7%,transparent);` +
|
|
1639
|
+
`color:${cvar("text")};outline:0}` +
|
|
1640
|
+
`${item}[aria-current]{background:color-mix(in srgb,${cvar("text")} 12%,transparent)}`;
|
|
1641
1641
|
|
|
1642
1642
|
},
|
|
1643
1643
|
"src/Component/usecase/headingAnchor.ts": function (module, exports, require) {
|
|
@@ -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) {
|
|
@@ -2369,9 +2374,10 @@ const dress = (c) => {
|
|
|
2369
2374
|
controls.className = p + "-sidebar-controls";
|
|
2370
2375
|
controls.setAttribute("role", "group");
|
|
2371
2376
|
controls.setAttribute("aria-label", label("表示設定", "Display settings"));
|
|
2372
|
-
|
|
2377
|
+
bar.append(controls);
|
|
2373
2378
|
drawerLabel.replaceWith(toggle);
|
|
2374
2379
|
for (const selector of [
|
|
2380
|
+
"." + p + "-chrome-links",
|
|
2375
2381
|
"." + p + "-lang",
|
|
2376
2382
|
"." + p + "-theme-toggle",
|
|
2377
2383
|
]) {
|
|
@@ -2381,7 +2387,7 @@ const dress = (c) => {
|
|
|
2381
2387
|
}
|
|
2382
2388
|
const language = controls.querySelector("." + p + "-lang");
|
|
2383
2389
|
if (language)
|
|
2384
|
-
language.setAttribute("data-opens", "
|
|
2390
|
+
language.setAttribute("data-opens", "down");
|
|
2385
2391
|
const sync = () => {
|
|
2386
2392
|
const expanded = desktop.matches
|
|
2387
2393
|
? !document.documentElement.hasAttribute(c.min)
|
|
@@ -2426,6 +2432,19 @@ const dress = (c) => {
|
|
|
2426
2432
|
divider.setAttribute("aria-hidden", "true");
|
|
2427
2433
|
divider.textContent = "›";
|
|
2428
2434
|
home.after(divider, trail);
|
|
2435
|
+
const pageFoot = shell.querySelector("." + p + "-doc-foot");
|
|
2436
|
+
const footText = pageFoot && pageFoot.textContent
|
|
2437
|
+
? pageFoot.textContent.trim()
|
|
2438
|
+
: "";
|
|
2439
|
+
if (footText !== "") {
|
|
2440
|
+
const foot = document.createElement("footer");
|
|
2441
|
+
foot.className = p + "-doc-shell-foot";
|
|
2442
|
+
foot.textContent = footText;
|
|
2443
|
+
if (sidebar)
|
|
2444
|
+
sidebar.append(foot);
|
|
2445
|
+
else
|
|
2446
|
+
strip.after(foot);
|
|
2447
|
+
}
|
|
2429
2448
|
const status = document.createElement("p");
|
|
2430
2449
|
status.className = p + "-doc-status";
|
|
2431
2450
|
status.setAttribute("role", "status");
|
|
@@ -2476,6 +2495,148 @@ const dress = (c) => {
|
|
|
2476
2495
|
.writeText(value)
|
|
2477
2496
|
.then(() => announce(done), fallback);
|
|
2478
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
|
+
};
|
|
2479
2640
|
const addActions = (col, mount) => {
|
|
2480
2641
|
const menu = document.createElement("details");
|
|
2481
2642
|
menu.className = actionsClass;
|
|
@@ -2500,6 +2661,29 @@ const dress = (c) => {
|
|
|
2500
2661
|
const folder = col.querySelector("." + c.fold);
|
|
2501
2662
|
if (folder)
|
|
2502
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
|
+
}
|
|
2503
2687
|
const last = columns().pop();
|
|
2504
2688
|
const next = last
|
|
2505
2689
|
? last.querySelector("." + actionsClass + " summary")
|
|
@@ -2510,10 +2694,9 @@ const dress = (c) => {
|
|
|
2510
2694
|
close.setAttribute("data-close-column", "");
|
|
2511
2695
|
if (col.querySelector("." + p + "-site-main")) {
|
|
2512
2696
|
action("copy", label("コンテンツをコピー", "Copy content"), () => {
|
|
2513
|
-
const content = col.querySelector("." + c.doc
|
|
2514
|
-
col.querySelector("." + c.doc);
|
|
2697
|
+
const content = col.querySelector("." + c.doc);
|
|
2515
2698
|
if (content)
|
|
2516
|
-
copy(content
|
|
2699
|
+
copy(markdownOf(content), label("コンテンツをコピーしました。", "Content copied."));
|
|
2517
2700
|
});
|
|
2518
2701
|
}
|
|
2519
2702
|
action("link", label("リンクをコピー", "Copy link"), () => copy(hrefFor(col), label("リンクをコピーしました。", "Link copied.")));
|
|
@@ -2551,17 +2734,7 @@ const dress = (c) => {
|
|
|
2551
2734
|
});
|
|
2552
2735
|
};
|
|
2553
2736
|
let shownColumns = 0;
|
|
2554
|
-
let homeColumn = null;
|
|
2555
|
-
home.addEventListener("click", (event) => {
|
|
2556
|
-
if (homeColumn &&
|
|
2557
|
-
homeColumn.isConnected &&
|
|
2558
|
-
columns().length > 1) {
|
|
2559
|
-
event.preventDefault();
|
|
2560
|
-
bring(homeColumn);
|
|
2561
|
-
}
|
|
2562
|
-
});
|
|
2563
2737
|
const sync = () => {
|
|
2564
|
-
homeColumn = null;
|
|
2565
2738
|
room.style.width = "0px";
|
|
2566
2739
|
const open = columns();
|
|
2567
2740
|
const crumbs = [];
|
|
@@ -2584,13 +2757,11 @@ 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
|
-
if (hrefFor(col) === home.href)
|
|
2591
|
-
homeColumn = col;
|
|
2763
|
+
if (hrefFor(col) === home.href)
|
|
2592
2764
|
return;
|
|
2593
|
-
}
|
|
2594
2765
|
const item = document.createElement("li");
|
|
2595
2766
|
const button = document.createElement("button");
|
|
2596
2767
|
button.type = "button";
|
|
@@ -2609,10 +2780,74 @@ const dress = (c) => {
|
|
|
2609
2780
|
!document.documentElement.hasAttribute(c.min))
|
|
2610
2781
|
fold.click();
|
|
2611
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
|
+
}
|
|
2612
2795
|
divider.hidden = crumbs.length === 0;
|
|
2613
2796
|
path.replaceChildren(...crumbs);
|
|
2614
2797
|
trail.scrollLeft = trail.scrollWidth;
|
|
2615
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
|
+
});
|
|
2837
|
+
document.addEventListener("click", (event) => {
|
|
2838
|
+
const target = event.target;
|
|
2839
|
+
for (const open of document.querySelectorAll("." + p + "-lang[open]")) {
|
|
2840
|
+
if (!(target instanceof Node) ||
|
|
2841
|
+
!open.contains(target))
|
|
2842
|
+
open.open = false;
|
|
2843
|
+
}
|
|
2844
|
+
});
|
|
2845
|
+
document.addEventListener("keydown", (event) => {
|
|
2846
|
+
if (event.key !== "Escape")
|
|
2847
|
+
return;
|
|
2848
|
+
for (const open of document.querySelectorAll("." + p + "-lang[open]"))
|
|
2849
|
+
open.open = false;
|
|
2850
|
+
});
|
|
2616
2851
|
document.addEventListener("click", (event) => {
|
|
2617
2852
|
const target = event.target;
|
|
2618
2853
|
for (const menu of strip.querySelectorAll("." + actionsClass + "[open]")) {
|
|
@@ -2631,6 +2866,7 @@ const dress = (c) => {
|
|
|
2631
2866
|
subtree: true,
|
|
2632
2867
|
});
|
|
2633
2868
|
sync();
|
|
2869
|
+
window.requestAnimationFrame(() => window.requestAnimationFrame(() => shell.classList.add(p + "-doc-chrome-ready")));
|
|
2634
2870
|
};
|
|
2635
2871
|
const docChromeInitScript = (theme) => "(" +
|
|
2636
2872
|
dress.toString() +
|
|
@@ -2652,9 +2888,13 @@ const docChromeCss = (theme) => {
|
|
|
2652
2888
|
`html:not([${marker_1.embeddedAttr}]) ${C} .${p}-shell-bar{display:flex}`,
|
|
2653
2889
|
`${C} .${p}-shell-bar-brand{flex:none;border-radius:.4rem;padding:.08rem .4rem;background:transparent;color:${v("text")}}`,
|
|
2654
2890
|
`${C} .${p}-shell-side :is(.${p}-shell-head,.${p}-shell-foot){display:none}`,
|
|
2655
|
-
|
|
2656
|
-
`${C} .${p}-
|
|
2657
|
-
|
|
2891
|
+
`${C} .${p}-shell-side{border-right-color:transparent}`,
|
|
2892
|
+
`${C} .${p}-row{overscroll-behavior-x:auto}`,
|
|
2893
|
+
`.${p}-sidebar-controls{display:flex;align-items:center;gap:.2rem;flex:none;margin-inline-start:auto}`,
|
|
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")}}`,
|
|
2658
2898
|
`@media (max-width:479px){${C} .${p}-shell-bar{gap:.25rem;padding-inline:.4rem}}`,
|
|
2659
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}`,
|
|
2660
2900
|
`${T}:hover{background:${tint(7)}}`,
|
|
@@ -2667,13 +2907,15 @@ const docChromeCss = (theme) => {
|
|
|
2667
2907
|
`${T}[aria-expanded="true"] span::before{transform:rotate(45deg)}`,
|
|
2668
2908
|
`${T}[aria-expanded="true"] span::after{transform:rotate(-45deg)}`,
|
|
2669
2909
|
`@media (min-width:1024px){` +
|
|
2670
|
-
`${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)}` +
|
|
2671
2911
|
`${C} .${p}-shell-side{overflow:hidden;transition:visibility 0s}` +
|
|
2672
|
-
`${C} .${p}-shell-side
|
|
2912
|
+
`${C} .${p}-shell-side .${p}-shell-body{min-width:16rem}` +
|
|
2673
2913
|
`${min} ${C},${C}${min}{${inset}:0px}` +
|
|
2674
2914
|
`${min} ${C} .${p}-shell-side{visibility:hidden;border-right-width:0;transition:visibility 0s .28s}` +
|
|
2675
2915
|
`${min} ${C} .${p}-shell-side .${p}-shell-body{display:block}` +
|
|
2676
|
-
`${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))}` +
|
|
2677
2919
|
`}`,
|
|
2678
2920
|
...shareCss_1.shareOptions.steps.map((step, i) => {
|
|
2679
2921
|
const below = i === 0
|
|
@@ -2711,9 +2953,11 @@ const docChromeCss = (theme) => {
|
|
|
2711
2953
|
`${A} button[hidden]{display:none}`,
|
|
2712
2954
|
`${A} button:hover{background:${tint(7)};color:${v("text")}}`,
|
|
2713
2955
|
`@media (pointer:coarse){${T},${A} summary{width:2.75rem;height:2.75rem}${A} button{min-height:2.75rem}}`,
|
|
2714
|
-
|
|
2956
|
+
`${C} .${p}-doc-foot{display:none}`,
|
|
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")}}`,
|
|
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")}}`,
|
|
2715
2959
|
`.${p}-doc-status:empty{display:none}`,
|
|
2716
|
-
`@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}}`,
|
|
2717
2961
|
].join("\n");
|
|
2718
2962
|
};
|
|
2719
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.14",
|
|
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",
|