reactive-md 0.9.3 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG-ch.md +34 -0
- package/CHANGELOG.md +34 -0
- package/README-ch.md +7 -7
- package/README-en.md +7 -7
- package/README.md +7 -7
- package/THIRD_PARTY_NOTICES.md +0 -57
- package/cli/help.mjs +6 -4
- package/cli/init.mjs +1 -1
- package/cli/migrate.mjs +1 -1
- package/dist-library/{LocalDocumentView-D6zQkTkt.js → LocalDocumentView-CP2QG86k.js} +46 -44
- package/dist-library/{LocalDocumentViewCore-CmJhemcA.js → LocalDocumentViewCore-Cd6yMEkg.js} +284 -265
- package/dist-library/{LocalReactiveDocumentCore-lAKOGAZ7.js → LocalReactiveDocumentCore-VuYpZqdn.js} +7 -7
- package/dist-library/LocalStaticDocumentView-DfX6bemE.js +147 -0
- package/dist-library/authoring-Bwu_zCWs.js +768 -0
- package/dist-library/choice-values-BItGjPD2.js +58 -0
- package/dist-library/compile-B35rfzKr.js +1742 -0
- package/dist-library/{compile-cache-key-6GgpETz_.js → compile-cache-key-D21X2Obx.js} +5 -5
- package/dist-library/{compiler-DLkKUK4t.js → compiler-DBwLawMZ.js} +4 -4
- package/dist-library/{compiler-core-Niqhp9wV.js → compiler-core-kkDiQ1RK.js} +3146 -2055
- package/dist-library/{component-kernel-IG4wOO0i.js → component-kernel-CsJSabHX.js} +42 -26
- package/dist-library/{component-state-Ht-hOK0W.js → component-state-Da0G8Ajc.js} +1 -1
- package/dist-library/{component-utils-eSj5IdG4.js → component-utils-ZM3jUJNy.js} +80 -79
- package/dist-library/conditional-branches-CIhJXasR.js +17 -0
- package/dist-library/{config-validation-Cpol91_M.js → config-validation-DbmsWAEV.js} +165 -152
- package/dist-library/{controls-B-CLSK8Q.js → controls-DRy5rzzN.js} +271 -228
- package/dist-library/{coordinate-PyLPMIQK.js → coordinate-c54pHfgf.js} +29 -29
- package/dist-library/data-table-CSAkm1eU.js +290 -0
- package/dist-library/data-table-model-DruztQFt.js +391 -0
- package/dist-library/{data-visuals-_Z7QqYTk.js → data-visuals-rZQUeQM0.js} +14 -14
- package/dist-library/{default-components-jugH7Ubr.js → default-components-B-39etG9.js} +233 -71
- package/dist-library/{default-config-DIrRpuQz.js → default-config-CCa8rm2k.js} +236 -216
- package/dist-library/default-options-By16CVw1.js +131 -0
- package/dist-library/{default-registry-BlloaZi7.js → default-registry-DXJy66xj.js} +3 -3
- package/dist-library/{default-schema-Ch-Vznpm.js → default-schema-CeYiEW1K.js} +3 -3
- package/dist-library/display-Bb6hAG5T.js +2065 -0
- package/dist-library/{document-theme-DBAfnk7y.js → document-theme-CJvN-nC1.js} +190 -3
- package/dist-library/{export-heVBqgxA.js → export-BSV4E0jv.js} +105 -106
- package/dist-library/font-aliases-CKYjwn4o.js +4 -0
- package/dist-library/{gallery-Q6VPS2ep.js → gallery-DM2yTVZJ.js} +1 -1
- package/dist-library/{html-CCnvzan1.js → html-CY9mC3Sr.js} +5 -5
- package/dist-library/{incremental-Bzvh8_lB.js → incremental-B-wW4H3F.js} +251 -245
- package/dist-library/{display-y4v9v0Qd.js → katex-4ukd4ZxT.js} +1555 -3618
- package/dist-library/layout-CPQggKxk.js +592 -0
- package/dist-library/{layout-BnfDeUNy.js → layout-CaDWsDof.js} +1 -1
- package/dist-library/{math-view-B0jthpRw.js → math-view-CyGTS6kv.js} +1 -1
- package/dist-library/{mount-preset-C_i37FvY.js → mount-preset-DtrCX4G8.js} +4 -4
- package/dist-library/{numeric-sliders-CkWS0-ja.js → numeric-sliders-BmJ1LCLx.js} +190 -190
- package/dist-library/{observability-CYLuvFfL.js → observability-BVQ16ByQ.js} +5 -4
- package/dist-library/{package-core-9UK5ZdqB.js → package-core-Cu_r_qs7.js} +7 -6
- package/dist-library/{parser-9yNJxGip.js → parser-BHl9Lxbw.js} +2 -2
- package/dist-library/{parser-standard-BPIy4HOu.js → parser-standard-DDAKv_DZ.js} +247 -247
- package/dist-library/{plugin-packs-CZb46nuv.js → plugin-packs-CkI0floL.js} +3 -3
- package/dist-library/{preset-core-BW3NWZJ9.js → preset-core-BKPbH_Nv.js} +377 -306
- package/dist-library/{props-pJRrfDc6.js → props-0iDqxlTk.js} +56 -61
- package/dist-library/{react-BSo0o998.js → react-74jdGBmu.js} +2 -2
- package/dist-library/reactive-md-authoring.js +277 -269
- package/dist-library/reactive-md-build.js +327 -33
- package/dist-library/reactive-md-compiler-session.js +3 -3
- package/dist-library/reactive-md-compiler-standard.js +10 -10
- package/dist-library/reactive-md-compiler.js +3 -3
- package/dist-library/reactive-md-contracts.js +4 -4
- package/dist-library/reactive-md-default-packs.js +4 -3
- package/dist-library/reactive-md-default-preset.js +3 -3
- package/dist-library/reactive-md-export.js +6 -6
- package/dist-library/reactive-md-minimal-preset.js +3 -2
- package/dist-library/reactive-md-minimal-react-preset.js +18 -17
- package/dist-library/reactive-md-minimal.css +1 -1
- package/dist-library/reactive-md-observability.js +2 -2
- package/dist-library/reactive-md-pack-style-manifest.js +8 -0
- package/dist-library/reactive-md-plugin-chart.js +13 -9
- package/dist-library/reactive-md-plugin-data.js +4 -4
- package/dist-library/reactive-md-plugin-diagram.js +3 -3
- package/dist-library/reactive-md-plugin-forms.js +5 -5
- package/dist-library/reactive-md-plugin-gallery.js +3 -3
- package/dist-library/reactive-md-plugin-navigation.js +10 -10
- package/dist-library/reactive-md-plugin-network.js +5 -5
- package/dist-library/reactive-md-plugin-plot.js +4 -4
- package/dist-library/reactive-md-react-component-accordion.js +3 -3
- package/dist-library/reactive-md-react-component-alert.js +3 -3
- package/dist-library/reactive-md-react-component-anchor.js +3 -3
- package/dist-library/reactive-md-react-component-badge.js +3 -3
- package/dist-library/reactive-md-react-component-card.js +3 -3
- package/dist-library/reactive-md-react-component-chart.js +2 -2
- package/dist-library/reactive-md-react-component-checkbox.js +2 -2
- package/dist-library/reactive-md-react-component-checklist.js +2 -2
- package/dist-library/reactive-md-react-component-choices.js +2 -2
- package/dist-library/reactive-md-react-component-column.js +1 -1
- package/dist-library/reactive-md-react-component-coordinate.js +2 -2
- package/dist-library/reactive-md-react-component-counter.js +2 -2
- package/dist-library/reactive-md-react-component-data-table.js +2 -2
- package/dist-library/reactive-md-react-component-date.js +2 -2
- package/dist-library/reactive-md-react-component-diagram.js +2 -2
- package/dist-library/reactive-md-react-component-disclosure.js +3 -3
- package/dist-library/reactive-md-react-component-edge.js +1 -1
- package/dist-library/reactive-md-react-component-else.js +10 -0
- package/dist-library/reactive-md-react-component-gallery-item.js +2 -2
- package/dist-library/reactive-md-react-component-gallery.js +2 -2
- package/dist-library/reactive-md-react-component-grid.js +3 -3
- package/dist-library/reactive-md-react-component-if.js +3 -3
- package/dist-library/reactive-md-react-component-input.js +2 -2
- package/dist-library/reactive-md-react-component-jump.js +3 -3
- package/dist-library/reactive-md-react-component-multi-select.js +2 -2
- package/dist-library/reactive-md-react-component-node.js +2 -2
- package/dist-library/reactive-md-react-component-number.js +2 -2
- package/dist-library/reactive-md-react-component-option.js +1 -1
- package/dist-library/reactive-md-react-component-panel.js +3 -3
- package/dist-library/reactive-md-react-component-plot.js +2 -2
- package/dist-library/reactive-md-react-component-progress.js +2 -2
- package/dist-library/reactive-md-react-component-quiz.js +2 -2
- package/dist-library/reactive-md-react-component-radio-group.js +2 -2
- package/dist-library/reactive-md-react-component-range-slider.js +2 -2
- package/dist-library/reactive-md-react-component-section.js +3 -3
- package/dist-library/reactive-md-react-component-select.js +2 -2
- package/dist-library/reactive-md-react-component-slider.js +2 -2
- package/dist-library/reactive-md-react-component-step.js +3 -3
- package/dist-library/reactive-md-react-component-steps.js +3 -3
- package/dist-library/reactive-md-react-component-tab.js +3 -3
- package/dist-library/reactive-md-react-component-table.js +2 -2
- package/dist-library/reactive-md-react-component-tabs.js +3 -3
- package/dist-library/reactive-md-react-component-text.js +3 -3
- package/dist-library/reactive-md-react-component-textarea.js +2 -2
- package/dist-library/reactive-md-react-component-timeline.js +2 -2
- package/dist-library/reactive-md-react-component-timer.js +2 -2
- package/dist-library/reactive-md-react-component-toggle.js +2 -2
- package/dist-library/reactive-md-react-component-tooltip.js +3 -3
- package/dist-library/reactive-md-react-component-validation.js +3 -3
- package/dist-library/reactive-md-react-minimal.js +4 -4
- package/dist-library/reactive-md-react-pack-controls.js +4 -4
- package/dist-library/reactive-md-react-pack-data.js +3 -3
- package/dist-library/reactive-md-react-pack-layout.js +25 -24
- package/dist-library/reactive-md-react-pack-visuals.js +2 -2
- package/dist-library/reactive-md-react-packed.js +6 -6
- package/dist-library/reactive-md-react-server.js +37 -36
- package/dist-library/reactive-md-react-static-server.js +2 -2
- package/dist-library/reactive-md-react-static.js +1 -1
- package/dist-library/reactive-md-react-unstyled.js +12 -12
- package/dist-library/reactive-md-react.js +12 -12
- package/dist-library/reactive-md-scan.js +1 -1
- package/dist-library/reactive-md-sdk.js +23 -9
- package/dist-library/reactive-md-standalone-configured.js +2 -2
- package/dist-library/reactive-md-standalone-host.js +2 -2
- package/dist-library/reactive-md-testing-browser.js +2 -2
- package/dist-library/reactive-md-testing-react.js +6 -6
- package/dist-library/reactive-md-testing.js +6 -6
- package/dist-library/reactive-md-vite.js +25 -9
- package/dist-library/reactive-md-worker-pool.js +3 -3
- package/dist-library/reactive-md.css +1 -1
- package/dist-library/reactive-md.js +52 -43
- package/dist-library/{registry-core-CziAIP5P.js → registry-core-DxEaxhJ6.js} +3 -2
- package/dist-library/{render-nodes-DKjg_TR1.js → render-nodes-B6j6Ip5I.js} +766 -731
- package/dist-library/{requirements-DhIkxAbl.js → requirements-C56sFIEs.js} +2 -2
- package/dist-library/{resources-B_nbROgj.js → resources-6VaNgk-h.js} +2 -2
- package/dist-library/rmd-pack-layout.css +9 -0
- package/dist-library/rmd-pack-resource-layout.css +9 -0
- package/dist-library/runtime-BHeuLOv_.js +1369 -0
- package/dist-library/{runtime-requirement-C4-vNcf5.js → runtime-requirement-DzPO8raU.js} +166 -163
- package/dist-library/{schema-core-4sd1Vu7V.js → schema-core-CDXfxdID.js} +24 -1
- package/dist-library/{sdk-core-BLsW9cCy.js → sdk-core-CnE-n0Z7.js} +469 -314
- package/dist-library/{session-core-DLBRPV7f.js → session-core-C071yQwV.js} +140 -127
- package/dist-library/{validation-XXlb-spV.js → sha256-utf16-Bmandi_H.js} +392 -315
- package/dist-library/shareable-CHCDnl6j.js +844 -0
- package/dist-library/types/authoring/catalog.d.ts +3 -1
- package/dist-library/types/authoring/index.d.ts +1 -1
- package/dist-library/types/components/chart/default-chart-types.d.ts +3 -0
- package/dist-library/types/components/chart/default-chart.d.ts +7 -0
- package/dist-library/types/components/entries/else.d.ts +3 -0
- package/dist-library/types/components/layout/layout.d.ts +5 -0
- package/dist-library/types/components/shared/visuals.d.ts +1 -1
- package/dist-library/types/components/table/data-table-model.d.ts +95 -2
- package/dist-library/types/components/table/data-table.d.ts +2 -2
- package/dist-library/types/contracts/component-kernel.d.ts +5 -0
- package/dist-library/types/contracts/font-aliases.d.ts +18 -0
- package/dist-library/types/contracts/number-literal.d.ts +2 -0
- package/dist-library/types/contracts/sha256-utf16.d.ts +2 -0
- package/dist-library/types/export/index.d.ts +4 -1
- package/dist-library/types/local/compilation/compiler-choices.d.ts +4 -0
- package/dist-library/types/local/compilation/compiler-declarations.d.ts +2 -1
- package/dist-library/types/local/compilation/compiler-expressions.d.ts +12 -1
- package/dist-library/types/local/compilation/compiler-macros.d.ts +18 -0
- package/dist-library/types/local/compilation/compiler-structure.d.ts +8 -2
- package/dist-library/types/local/compilation/compiler-tables.d.ts +1 -0
- package/dist-library/types/local/compilation/compiler-validation.d.ts +11 -0
- package/dist-library/types/local/compilation/compiler-values.d.ts +1 -2
- package/dist-library/types/local/configuration/diagnostic-messages.d.ts +173 -2
- package/dist-library/types/local/configuration/diagnostic-runtime-messages.d.ts +40 -0
- package/dist-library/types/local/evaluation/choice-values.d.ts +22 -0
- package/dist-library/types/local/evaluation/computations.d.ts +13 -5
- package/dist-library/types/local/evaluation/dataset.d.ts +4 -0
- package/dist-library/types/local/evaluation/expression/collection-functions.d.ts +13 -0
- package/dist-library/types/local/evaluation/expression/compile.d.ts +11 -4
- package/dist-library/types/local/evaluation/expression/data-functions.d.ts +23 -0
- package/dist-library/types/local/evaluation/expression/evaluation.d.ts +3 -1
- package/dist-library/types/local/evaluation/expression/internal-names.d.ts +8 -0
- package/dist-library/types/local/evaluation/expression/syntax.d.ts +19 -2
- package/dist-library/types/local/evaluation/expression/transform-budget.d.ts +13 -0
- package/dist-library/types/local/evaluation/expression/values.d.ts +9 -1
- package/dist-library/types/local/evaluation/validation.d.ts +8 -6
- package/dist-library/types/local/index.d.ts +4 -3
- package/dist-library/types/local/parsing/conditional-branches.d.ts +4 -0
- package/dist-library/types/local/parsing/source-revision.d.ts +3 -0
- package/dist-library/types/local/runtime/runtime-choices.d.ts +11 -0
- package/dist-library/types/local/runtime/runtime.d.ts +3 -1
- package/dist-library/types/local/runtime/state.d.ts +30 -15
- package/dist-library/types/local/source/authoring-requirements.d.ts +3 -0
- package/dist-library/types/local/source/authoring-syntax.d.ts +3 -2
- package/dist-library/types/local/source/authoring.d.ts +10 -0
- package/dist-library/types/local/source/source-migration.d.ts +1 -0
- package/dist-library/types/local/types.d.ts +33 -2
- package/dist-library/types/react/component-api.d.ts +21 -2
- package/dist-library/types/react/component-utils.d.ts +11 -0
- package/dist-library/types/react/font-aliases.d.ts +2 -0
- package/dist-library/types/react/package-core.d.ts +3 -0
- package/dist-library/types/react/rendering/document/validation-state.d.ts +1 -1
- package/dist-library/types/react/rendering/document/view-revision.d.ts +3 -12
- package/dist-library/types/react/rendering/table/data-table.d.ts +1 -1
- package/dist-library/types/react/sdk-core.d.ts +3 -1
- package/dist-library/types/sdk/assembly.d.ts +3 -0
- package/dist-library/types/sdk/font.d.ts +13 -0
- package/dist-library/types/sdk/index.d.ts +1 -0
- package/dist-library/types/sdk/theme.d.ts +5 -0
- package/dist-library/types/sdk/types.d.ts +6 -0
- package/dist-library/types/sdk/version.d.ts +1 -1
- package/dist-library/types/shareable.d.ts +15 -3
- package/dist-library/types/standalone/prepare.d.ts +4 -2
- package/dist-library/types/standalone/session-core.d.ts +4 -1
- package/dist-library/types/vite/index.d.ts +3 -0
- package/dist-library/types/vite/registration.d.ts +1 -0
- package/dist-library/{types-Bza88SGK.js → types-B4qG8J4S.js} +1 -1
- package/dist-library/types-FYhRWRn9.js +3 -0
- package/dist-library/use-hydrated-D1gFY2Dq.js +2655 -0
- package/dist-library/validation-DRuW0Wl9.js +433 -0
- package/dist-library/{version-B0G1699c.js → version-4wzhbvDG.js} +1 -1
- package/dist-library/{visual-helpers-CRmaqCHX.js → visual-helpers-UU6xiL8g.js} +3 -3
- package/dist-library/visuals-7xzoL9ql.js +49340 -0
- package/dist-library/{worker-D6WMV8xJ.js → worker-3ldRjOEG.js} +9 -9
- package/dist-standalone/reactive-md-standalone.css +1 -1
- package/dist-standalone/reactive-md-standalone.js +128 -368
- package/docs/README-ch.md +3 -1
- package/docs/README.md +3 -1
- package/docs/compatibility/api-stability-ch.md +1 -1
- package/docs/compatibility/api-stability-en.md +1 -1
- package/docs/compatibility/compatibility-ch.md +15 -15
- package/docs/compatibility/compatibility-en.md +15 -15
- package/docs/compatibility/compatibility-manifest.schema.json +3 -2
- package/docs/compatibility/deprecation-ch.md +2 -2
- package/docs/compatibility/deprecation-en.md +2 -2
- package/docs/compatibility/source-versioning-ch.md +22 -14
- package/docs/compatibility/source-versioning-en.md +22 -13
- package/docs/compatibility/support-matrix-ch.md +4 -3
- package/docs/compatibility/support-matrix-en.md +4 -3
- package/docs/development/component-development-ch.md +2 -2
- package/docs/development/component-development-en.md +2 -2
- package/docs/development/component-protocol-ch.md +18 -18
- package/docs/development/component-protocol-en.md +14 -14
- package/docs/guides/local-guide-ch.md +109 -20
- package/docs/guides/local-guide-en.md +109 -20
- package/docs/integration/author-tools-ch.md +1 -1
- package/docs/integration/author-tools-en.md +1 -1
- package/docs/integration/editor-ch.md +3 -3
- package/docs/integration/editor-en.md +3 -3
- package/docs/integration/extension-sdk-ch.md +29 -3
- package/docs/integration/extension-sdk-en.md +29 -3
- package/docs/integration/local-integration-ch.md +3 -3
- package/docs/integration/local-integration-en.md +3 -3
- package/docs/integration/pdf-export-ch.md +42 -0
- package/docs/integration/pdf-export-en.md +42 -0
- package/docs/integration/shareable-export-ch.md +11 -19
- package/docs/integration/shareable-export-en.md +11 -19
- package/docs/reference/diagnostics-counting-ch.md +24 -1
- package/docs/reference/diagnostics-counting-en.md +24 -1
- package/docs/reference/local-interaction-syntax-ch.md +222 -33
- package/docs/reference/local-interaction-syntax-en.md +220 -31
- package/docs/reference/public-api-ch.md +24 -18
- package/docs/reference/public-api-en.md +24 -18
- package/docs/reference/theme-protocol-ch.md +1 -1
- package/docs/reference/theme-protocol-en.md +1 -1
- package/docs/releases/release-0.10.0-ch.md +45 -0
- package/docs/releases/release-0.10.0-en.md +45 -0
- package/examples/conformance/README-ch.md +3 -3
- package/examples/conformance/README.md +3 -3
- package/examples/conformance/local-draft-4.json +441 -0
- package/examples/integration/README-ch.md +3 -3
- package/examples/integration/README.md +3 -3
- package/examples/integration/chat-session/package.json +1 -1
- package/examples/local/README-ch.md +1 -1
- package/examples/local/README.md +1 -1
- package/package.json +6 -1
- package/dist-library/LocalStaticDocumentView-2J7w0sKm.js +0 -143
- package/dist-library/authoring-B14SsOXZ.js +0 -893
- package/dist-library/compile-D50B5_Ww.js +0 -1249
- package/dist-library/computations-CffoW7Ff.js +0 -340
- package/dist-library/data-table-Kv_ZA2Z2.js +0 -297
- package/dist-library/default-options-DU5dxuU6.js +0 -125
- package/dist-library/layout-BfUzzO2b.js +0 -553
- package/dist-library/runtime-CuJndKqK.js +0 -1289
- package/dist-library/shareable-C6mUerpQ.js +0 -817
- package/dist-library/types-daDo2c_w.js +0 -3
- package/dist-library/use-hydrated-W-laKPhY.js +0 -22975
- package/dist-library/visuals-CoVSjVD8.js +0 -49159
|
@@ -0,0 +1,592 @@
|
|
|
1
|
+
import { P as e } from "./preset-core-BKPbH_Nv.js";
|
|
2
|
+
import { A as t, C as n, I as r, M as i, P as a, R as o, _ as s, c, i as l, j as u, k as d, n as f, o as p, r as m, s as h, t as g, v as _ } from "./component-utils-ZM3jUJNy.js";
|
|
3
|
+
import { t as v } from "./font-aliases-CKYjwn4o.js";
|
|
4
|
+
import { n as y, t as b } from "./tooltip-layer-HDLrSWs0.js";
|
|
5
|
+
import { useContext as x, useEffect as S, useId as C, useRef as w, useState as T } from "react";
|
|
6
|
+
import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
7
|
+
// src/components/layout/layout.tsx
|
|
8
|
+
function k(e) {
|
|
9
|
+
let t = u(e), n = i(e), { content: r, runtime: a, mode: o, t: s } = n, l = d(e, "title", ""), f = c(e, "reset", !0) && o !== "static", [p, m] = T(null), h = () => {
|
|
10
|
+
try {
|
|
11
|
+
a.reset(r), m(null);
|
|
12
|
+
} catch (e) {
|
|
13
|
+
m(e instanceof Error ? e.message : s("Cannot reset", "无法恢复默认"));
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
return /* @__PURE__ */ O("section", {
|
|
17
|
+
...t(),
|
|
18
|
+
className: "md-panel local-panel",
|
|
19
|
+
"aria-label": l || s("Parameter panel", "参数面板"),
|
|
20
|
+
children: [
|
|
21
|
+
l || f ? /* @__PURE__ */ O("div", {
|
|
22
|
+
className: "local-panel-head",
|
|
23
|
+
children: [l ? /* @__PURE__ */ D("h3", {
|
|
24
|
+
className: "md-panel-title local-panel-title",
|
|
25
|
+
children: l
|
|
26
|
+
}) : /* @__PURE__ */ D("span", {}), f ? /* @__PURE__ */ D("button", {
|
|
27
|
+
type: "button",
|
|
28
|
+
className: "md-button md-button-quiet local-panel-reset",
|
|
29
|
+
onClick: h,
|
|
30
|
+
"aria-label": l ? s(`Reset ${l}`, `${l} 恢复默认`) : s("Reset", "恢复默认"),
|
|
31
|
+
children: s("Reset", "恢复默认")
|
|
32
|
+
}) : null]
|
|
33
|
+
}) : null,
|
|
34
|
+
/* @__PURE__ */ D("div", {
|
|
35
|
+
className: "md-panel-body local-panel-body",
|
|
36
|
+
children: n.render()
|
|
37
|
+
}),
|
|
38
|
+
/* @__PURE__ */ D(g, { message: p })
|
|
39
|
+
]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function A(e) {
|
|
43
|
+
let t = u(e), n = i(e), r = d(e, "title", "");
|
|
44
|
+
return /* @__PURE__ */ O("section", {
|
|
45
|
+
...t(),
|
|
46
|
+
className: "md-card local-card",
|
|
47
|
+
children: [r ? /* @__PURE__ */ D("h3", {
|
|
48
|
+
className: "md-card-title",
|
|
49
|
+
children: r
|
|
50
|
+
}) : null, /* @__PURE__ */ D("div", {
|
|
51
|
+
className: "md-card-body",
|
|
52
|
+
children: n.render()
|
|
53
|
+
})]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function j(e) {
|
|
57
|
+
let t = u(e), n = i(e), r = Math.min(4, Math.max(1, Math.floor(Number(e.props.columns ?? 2) || 2)));
|
|
58
|
+
return /* @__PURE__ */ D("div", {
|
|
59
|
+
className: "local-grid",
|
|
60
|
+
...t({ "--local-grid-columns": String(r) }),
|
|
61
|
+
children: n.render()
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function M(e) {
|
|
65
|
+
let t = u(e), n = i(e);
|
|
66
|
+
return /* @__PURE__ */ D("div", {
|
|
67
|
+
...t(),
|
|
68
|
+
className: "local-tabpanel-body",
|
|
69
|
+
children: n.render()
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function N(e) {
|
|
73
|
+
let t = u(e), c = i(e), f = C(), { content: p, mode: h, visible: _, t: v } = c, { write: y, error: b } = o(e), x = d(e, "label", ""), S = r(e), E = p.children.filter((e) => e.kind === "component" && e.name === "tab"), k = E.map((e, t) => n(e, "value") ?? `tab-${t + 1}`), A = E.map((t, n) => s(e, t, "label", k[n])), j = n(p, "initial") ?? k[0] ?? "", M = n(p, "bind") !== void 0, N = e.runtime.get(p), P = typeof N == "string" ? N : "", [F, I] = T(() => k.includes(j) ? j : k[0] ?? ""), L = w([]);
|
|
74
|
+
if (a(e, () => {
|
|
75
|
+
I(k.includes(j) ? j : k[0] ?? "");
|
|
76
|
+
}), E.length === 0) return /* @__PURE__ */ D(m, { message: v("Tabs requires at least one tab", "标签页至少需要一个 tab") });
|
|
77
|
+
if (h === "static") return /* @__PURE__ */ O("section", {
|
|
78
|
+
...t(),
|
|
79
|
+
className: "local-tabs local-static-tabs",
|
|
80
|
+
"aria-label": x || v("Tabs", "选项卡"),
|
|
81
|
+
children: [x ? /* @__PURE__ */ D("div", {
|
|
82
|
+
className: "local-tabs-label",
|
|
83
|
+
children: x
|
|
84
|
+
}) : null, E.map((e, t) => /* @__PURE__ */ O("section", {
|
|
85
|
+
className: "local-static-tab",
|
|
86
|
+
children: [/* @__PURE__ */ D("h4", {
|
|
87
|
+
className: "local-static-tab-label",
|
|
88
|
+
children: A[t]
|
|
89
|
+
}), /* @__PURE__ */ D("div", {
|
|
90
|
+
className: "local-static-tab-body",
|
|
91
|
+
children: c.render(e.children, _)
|
|
92
|
+
})]
|
|
93
|
+
}, e.id))]
|
|
94
|
+
});
|
|
95
|
+
let R = M ? k.includes(P) ? P : k[0] : k.includes(F) ? F : k[0], z = Math.max(0, k.indexOf(R)), B = (e) => {
|
|
96
|
+
let t = k[e];
|
|
97
|
+
t !== void 0 && (M ? y(t) : I(t), L.current[e]?.focus());
|
|
98
|
+
}, V = (e) => {
|
|
99
|
+
let t = -1;
|
|
100
|
+
e.key === "ArrowRight" ? t = (z + 1) % E.length : e.key === "ArrowLeft" ? t = (z - 1 + E.length) % E.length : e.key === "Home" ? t = 0 : e.key === "End" && (t = E.length - 1), !(t < 0) && (e.preventDefault(), B(t));
|
|
101
|
+
};
|
|
102
|
+
return /* @__PURE__ */ O("section", {
|
|
103
|
+
...t(),
|
|
104
|
+
className: "md-tabs local-tabs",
|
|
105
|
+
"aria-label": x || v("Tabs", "选项卡"),
|
|
106
|
+
"aria-invalid": S.invalid || void 0,
|
|
107
|
+
"aria-describedby": S.describedBy,
|
|
108
|
+
children: [
|
|
109
|
+
x ? /* @__PURE__ */ D("div", {
|
|
110
|
+
className: "local-tabs-label",
|
|
111
|
+
children: x
|
|
112
|
+
}) : null,
|
|
113
|
+
/* @__PURE__ */ D("div", {
|
|
114
|
+
className: "md-tablist local-tablist",
|
|
115
|
+
role: "tablist",
|
|
116
|
+
"aria-label": x || v("Tabs", "选项卡"),
|
|
117
|
+
onKeyDown: V,
|
|
118
|
+
children: E.map((e, t) => {
|
|
119
|
+
let n = k[t], r = n === R;
|
|
120
|
+
return /* @__PURE__ */ D("button", {
|
|
121
|
+
ref: (e) => {
|
|
122
|
+
L.current[t] = e;
|
|
123
|
+
},
|
|
124
|
+
id: `${f}-tab-${t}`,
|
|
125
|
+
type: "button",
|
|
126
|
+
role: "tab",
|
|
127
|
+
className: `md-tab local-tab${r ? " is-selected" : ""}`,
|
|
128
|
+
"aria-selected": r,
|
|
129
|
+
"aria-controls": `${f}-panel-${t}`,
|
|
130
|
+
tabIndex: r ? 0 : -1,
|
|
131
|
+
onClick: () => {
|
|
132
|
+
M ? y(n) : I(n);
|
|
133
|
+
},
|
|
134
|
+
children: A[t]
|
|
135
|
+
}, e.id);
|
|
136
|
+
})
|
|
137
|
+
}),
|
|
138
|
+
E.map((e, t) => {
|
|
139
|
+
let n = k[t] === R;
|
|
140
|
+
return /* @__PURE__ */ O("div", {
|
|
141
|
+
id: `${f}-panel-${t}`,
|
|
142
|
+
className: "md-tabpanel local-tabpanel",
|
|
143
|
+
role: "tabpanel",
|
|
144
|
+
"aria-labelledby": `${f}-tab-${t}`,
|
|
145
|
+
tabIndex: 0,
|
|
146
|
+
hidden: !n,
|
|
147
|
+
children: [/* @__PURE__ */ D(l, {
|
|
148
|
+
block: !0,
|
|
149
|
+
value: A[t]
|
|
150
|
+
}), c.render(e.children, _ && n)]
|
|
151
|
+
}, e.id);
|
|
152
|
+
}),
|
|
153
|
+
/* @__PURE__ */ D(g, { message: b })
|
|
154
|
+
]
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
function P(e) {
|
|
158
|
+
let t = u(e), c = i(e), l = C(), { content: f, mode: p, visible: h, t: _ } = c, { write: v, error: y, setError: b } = o(e), x = d(e, "label", ""), T = r(e), E = f.children.filter((e) => e.kind === "component" && e.name === "step"), k = E.map((e, t) => n(e, "value") ?? `step-${t + 1}`), A = E.map((t, n) => s(e, t, "label", k[n])), j = n(f, "initial") ?? "", M = k.includes(j) ? j : k[0] ?? "", N = e.runtime.get(f), P = typeof N == "string" ? N : "", F = w([]), I = w(!1);
|
|
159
|
+
a(e, () => {
|
|
160
|
+
b(null), I.current = !1;
|
|
161
|
+
});
|
|
162
|
+
let L = k.includes(P) ? P : M, R = Math.max(0, k.indexOf(L));
|
|
163
|
+
if (S(() => {
|
|
164
|
+
I.current && (I.current = !1, F.current[R]?.focus({ preventScroll: !0 }));
|
|
165
|
+
}, [R, L]), E.length === 0) return /* @__PURE__ */ D(m, { message: _("Steps requires at least one step", "步骤至少需要一个 step") });
|
|
166
|
+
if (p === "static") {
|
|
167
|
+
let e = E[R];
|
|
168
|
+
return /* @__PURE__ */ O("section", {
|
|
169
|
+
...t(),
|
|
170
|
+
className: "local-steps local-static-steps",
|
|
171
|
+
"aria-label": x || _("Steps", "步骤"),
|
|
172
|
+
children: [
|
|
173
|
+
x ? /* @__PURE__ */ D("div", {
|
|
174
|
+
className: "local-steps-label",
|
|
175
|
+
children: x
|
|
176
|
+
}) : null,
|
|
177
|
+
/* @__PURE__ */ D("ol", {
|
|
178
|
+
className: "local-steps-rail",
|
|
179
|
+
"aria-hidden": "true",
|
|
180
|
+
style: { "--local-steps-progress": `${E.length <= 1 ? 100 : R / (E.length - 1) * 100}%` },
|
|
181
|
+
children: E.map((e, t) => /* @__PURE__ */ D("li", {
|
|
182
|
+
className: `local-steps-dot${t < R ? " is-complete" : t === R ? " is-current" : ""}`,
|
|
183
|
+
children: /* @__PURE__ */ D("span", { children: t + 1 })
|
|
184
|
+
}, e.id))
|
|
185
|
+
}),
|
|
186
|
+
/* @__PURE__ */ D("div", {
|
|
187
|
+
className: "local-steps-nav local-static-steps-nav",
|
|
188
|
+
children: /* @__PURE__ */ D("span", {
|
|
189
|
+
className: "local-steps-status",
|
|
190
|
+
role: "status",
|
|
191
|
+
"aria-live": "polite",
|
|
192
|
+
children: _(`Step ${R + 1} of ${E.length}`, `第 ${R + 1} 步,共 ${E.length} 步`)
|
|
193
|
+
})
|
|
194
|
+
}),
|
|
195
|
+
/* @__PURE__ */ D("div", {
|
|
196
|
+
className: "local-steps-panel",
|
|
197
|
+
role: "group",
|
|
198
|
+
"aria-label": A[R],
|
|
199
|
+
children: c.render(e.children, h)
|
|
200
|
+
})
|
|
201
|
+
]
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
let z = (e) => {
|
|
205
|
+
let t = k[e];
|
|
206
|
+
t !== void 0 && (I.current = !0, v(t));
|
|
207
|
+
};
|
|
208
|
+
return /* @__PURE__ */ O("section", {
|
|
209
|
+
...t(),
|
|
210
|
+
className: "local-steps",
|
|
211
|
+
"aria-label": x || _("Steps", "步骤"),
|
|
212
|
+
"aria-invalid": T.invalid || void 0,
|
|
213
|
+
"aria-describedby": T.describedBy,
|
|
214
|
+
children: [
|
|
215
|
+
x ? /* @__PURE__ */ D("div", {
|
|
216
|
+
className: "local-steps-label",
|
|
217
|
+
children: x
|
|
218
|
+
}) : null,
|
|
219
|
+
/* @__PURE__ */ D("ol", {
|
|
220
|
+
className: "local-steps-rail",
|
|
221
|
+
"aria-hidden": "true",
|
|
222
|
+
style: { "--local-steps-progress": `${E.length <= 1 ? 100 : R / (E.length - 1) * 100}%` },
|
|
223
|
+
children: E.map((e, t) => /* @__PURE__ */ D("li", {
|
|
224
|
+
className: `local-steps-dot${t < R ? " is-complete" : t === R ? " is-current" : ""}`,
|
|
225
|
+
children: /* @__PURE__ */ D("span", { children: t + 1 })
|
|
226
|
+
}, e.id))
|
|
227
|
+
}),
|
|
228
|
+
/* @__PURE__ */ O("div", {
|
|
229
|
+
className: "local-steps-nav",
|
|
230
|
+
children: [
|
|
231
|
+
/* @__PURE__ */ D("button", {
|
|
232
|
+
type: "button",
|
|
233
|
+
className: "md-button md-button-secondary local-steps-prev",
|
|
234
|
+
disabled: R <= 0,
|
|
235
|
+
onClick: () => z(R - 1),
|
|
236
|
+
children: _("Previous", "上一步")
|
|
237
|
+
}),
|
|
238
|
+
/* @__PURE__ */ D("span", {
|
|
239
|
+
className: "local-steps-status",
|
|
240
|
+
role: "status",
|
|
241
|
+
"aria-live": "polite",
|
|
242
|
+
children: _(`Step ${R + 1} of ${E.length}`, `第 ${R + 1} 步,共 ${E.length} 步`)
|
|
243
|
+
}),
|
|
244
|
+
/* @__PURE__ */ D("button", {
|
|
245
|
+
type: "button",
|
|
246
|
+
className: "md-button md-button-secondary local-steps-next",
|
|
247
|
+
disabled: R >= E.length - 1,
|
|
248
|
+
onClick: () => z(R + 1),
|
|
249
|
+
children: _("Next", "下一步")
|
|
250
|
+
})
|
|
251
|
+
]
|
|
252
|
+
}),
|
|
253
|
+
E.map((e, t) => {
|
|
254
|
+
let n = t === R;
|
|
255
|
+
return /* @__PURE__ */ D("div", {
|
|
256
|
+
id: `${l}-step-${t}`,
|
|
257
|
+
ref: (e) => {
|
|
258
|
+
F.current[t] = e;
|
|
259
|
+
},
|
|
260
|
+
className: "local-steps-panel",
|
|
261
|
+
role: "group",
|
|
262
|
+
"aria-label": A[t],
|
|
263
|
+
tabIndex: -1,
|
|
264
|
+
hidden: !n,
|
|
265
|
+
children: c.render(e.children, h && n)
|
|
266
|
+
}, e.id);
|
|
267
|
+
}),
|
|
268
|
+
/* @__PURE__ */ D(g, { message: y })
|
|
269
|
+
]
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
function F() {
|
|
273
|
+
return null;
|
|
274
|
+
}
|
|
275
|
+
function I(e) {
|
|
276
|
+
let t = u(e), n = i(e), r = d(e, "label", "");
|
|
277
|
+
return /* @__PURE__ */ O("div", {
|
|
278
|
+
...t(),
|
|
279
|
+
className: "local-accordion",
|
|
280
|
+
role: "group",
|
|
281
|
+
"aria-label": r || n.t("Accordion", "折叠面板"),
|
|
282
|
+
children: [r ? /* @__PURE__ */ D("div", {
|
|
283
|
+
className: "local-accordion-label",
|
|
284
|
+
children: r
|
|
285
|
+
}) : null, n.render()]
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
function L(e) {
|
|
289
|
+
let t = u(e), n = i(e), r = C(), { mode: o, visible: s, t: f } = n, p = d(e, "label", f("Details", "折叠内容")), m = c(e, "open", !1), [h, g] = T(m);
|
|
290
|
+
if (a(e, () => {
|
|
291
|
+
g(m);
|
|
292
|
+
}), o === "static") return /* @__PURE__ */ O("section", {
|
|
293
|
+
...t(),
|
|
294
|
+
className: "local-disclosure local-static-disclosure",
|
|
295
|
+
children: [/* @__PURE__ */ D("h3", {
|
|
296
|
+
className: "local-disclosure-heading",
|
|
297
|
+
children: p
|
|
298
|
+
}), /* @__PURE__ */ D("div", {
|
|
299
|
+
className: "local-disclosure-panel",
|
|
300
|
+
children: n.render()
|
|
301
|
+
})]
|
|
302
|
+
});
|
|
303
|
+
let _ = `${r}-disclosure-trigger`, v = `${r}-disclosure-panel`;
|
|
304
|
+
return /* @__PURE__ */ O("div", {
|
|
305
|
+
...t(),
|
|
306
|
+
className: "local-disclosure",
|
|
307
|
+
children: [/* @__PURE__ */ O("h3", {
|
|
308
|
+
className: "local-disclosure-heading",
|
|
309
|
+
children: [/* @__PURE__ */ O("button", {
|
|
310
|
+
id: _,
|
|
311
|
+
type: "button",
|
|
312
|
+
className: "local-disclosure-trigger",
|
|
313
|
+
"data-rmd-appearance": "custom",
|
|
314
|
+
"aria-expanded": h,
|
|
315
|
+
"aria-controls": v,
|
|
316
|
+
onClick: () => g((e) => !e),
|
|
317
|
+
children: [/* @__PURE__ */ D("span", {
|
|
318
|
+
className: "local-disclosure-label",
|
|
319
|
+
children: p
|
|
320
|
+
}), /* @__PURE__ */ D("svg", {
|
|
321
|
+
className: `local-chevron${h ? " is-open" : ""}`,
|
|
322
|
+
viewBox: "0 0 24 24",
|
|
323
|
+
width: "17",
|
|
324
|
+
height: "17",
|
|
325
|
+
fill: "none",
|
|
326
|
+
stroke: "currentColor",
|
|
327
|
+
strokeWidth: "1.75",
|
|
328
|
+
strokeLinecap: "round",
|
|
329
|
+
strokeLinejoin: "round",
|
|
330
|
+
"aria-hidden": "true",
|
|
331
|
+
focusable: "false",
|
|
332
|
+
children: /* @__PURE__ */ D("path", { d: "m6 9 6 6 6-6" })
|
|
333
|
+
})]
|
|
334
|
+
}), /* @__PURE__ */ D(l, { value: p })]
|
|
335
|
+
}), /* @__PURE__ */ D("div", {
|
|
336
|
+
id: v,
|
|
337
|
+
className: "local-disclosure-panel",
|
|
338
|
+
role: "region",
|
|
339
|
+
"aria-labelledby": _,
|
|
340
|
+
hidden: !h,
|
|
341
|
+
inert: !h,
|
|
342
|
+
children: /* @__PURE__ */ D("div", {
|
|
343
|
+
className: "local-disclosure-body",
|
|
344
|
+
children: n.render(void 0, s)
|
|
345
|
+
})
|
|
346
|
+
})]
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
function R(e) {
|
|
350
|
+
let t = u(e)(), r = i(e), { content: a, t: o, visible: s } = r, c = n(a, "when"), l = e.props.when, d = typeof l == "boolean" && l, f = c !== void 0 && typeof l != "boolean", p = w(null), h = w(d), g = w(!1);
|
|
351
|
+
return S(() => {
|
|
352
|
+
if (h.current && !d) {
|
|
353
|
+
if (g.current) {
|
|
354
|
+
let e = p.current?.closest(".local-document");
|
|
355
|
+
e && (e.tabIndex = -1, e.focus({ preventScroll: !0 }));
|
|
356
|
+
}
|
|
357
|
+
g.current = !1;
|
|
358
|
+
}
|
|
359
|
+
h.current = d;
|
|
360
|
+
}, [d]), /* @__PURE__ */ O(E, { children: [f ? /* @__PURE__ */ D(m, { message: o("Cannot compute", "无法计算") }) : null, /* @__PURE__ */ D("div", {
|
|
361
|
+
style: t.style,
|
|
362
|
+
ref: (e) => {
|
|
363
|
+
p.current = e, t.ref?.(e);
|
|
364
|
+
},
|
|
365
|
+
className: "local-if md-if",
|
|
366
|
+
role: "group",
|
|
367
|
+
"aria-label": o("Conditional content", "条件内容"),
|
|
368
|
+
tabIndex: -1,
|
|
369
|
+
hidden: !d,
|
|
370
|
+
"aria-hidden": !d,
|
|
371
|
+
onFocus: () => {
|
|
372
|
+
g.current = !0;
|
|
373
|
+
},
|
|
374
|
+
onBlur: (e) => {
|
|
375
|
+
p.current?.contains(e.relatedTarget) || (g.current = !1);
|
|
376
|
+
},
|
|
377
|
+
children: r.render(void 0, s && d)
|
|
378
|
+
})] });
|
|
379
|
+
}
|
|
380
|
+
function z(e) {
|
|
381
|
+
let t = u(e)(), n = i(e), { content: r, t: a, visible: o } = n, s = x(f), c = s?.elseId === r.id ? s : null, l = c?.shown === !0, d = w(null), p = w(l), h = w(!1);
|
|
382
|
+
return S(() => {
|
|
383
|
+
if (p.current && !l) {
|
|
384
|
+
if (h.current) {
|
|
385
|
+
let e = d.current?.closest(".local-document");
|
|
386
|
+
e && (e.tabIndex = -1, e.focus({ preventScroll: !0 }));
|
|
387
|
+
}
|
|
388
|
+
h.current = !1;
|
|
389
|
+
}
|
|
390
|
+
p.current = l;
|
|
391
|
+
}, [l]), /* @__PURE__ */ O(E, { children: [c?.error ? /* @__PURE__ */ D(m, { message: a("Cannot compute", "无法计算") }) : null, /* @__PURE__ */ D("div", {
|
|
392
|
+
style: t.style,
|
|
393
|
+
ref: (e) => {
|
|
394
|
+
d.current = e, t.ref?.(e);
|
|
395
|
+
},
|
|
396
|
+
className: "local-if md-if local-else",
|
|
397
|
+
role: "group",
|
|
398
|
+
"aria-label": a("Alternative content", "否则内容"),
|
|
399
|
+
tabIndex: -1,
|
|
400
|
+
hidden: !l,
|
|
401
|
+
"aria-hidden": !l,
|
|
402
|
+
onFocus: () => {
|
|
403
|
+
h.current = !0;
|
|
404
|
+
},
|
|
405
|
+
onBlur: (e) => {
|
|
406
|
+
d.current?.contains(e.relatedTarget) || (h.current = !1);
|
|
407
|
+
},
|
|
408
|
+
children: n.render(void 0, o && l)
|
|
409
|
+
})] });
|
|
410
|
+
}
|
|
411
|
+
function B(e) {
|
|
412
|
+
let n = u(e), r = i(e), a = d(e, "title", ""), { tone: o, error: s } = t(e, "tone", [
|
|
413
|
+
"info",
|
|
414
|
+
"success",
|
|
415
|
+
"warning",
|
|
416
|
+
"error"
|
|
417
|
+
], "info"), c = o === "warning" || o === "error" ? "alert" : "status";
|
|
418
|
+
return /* @__PURE__ */ O(E, { children: [s ? /* @__PURE__ */ D(p, { message: r.t("Invalid tone; using the default style", "色调无效,已使用默认样式") }) : null, /* @__PURE__ */ O("div", {
|
|
419
|
+
className: `md-alert md-alert-${o} local-alert local-alert-${o}`,
|
|
420
|
+
role: c,
|
|
421
|
+
...n(),
|
|
422
|
+
children: [a ? /* @__PURE__ */ D("div", {
|
|
423
|
+
className: "md-alert-title local-alert-title",
|
|
424
|
+
children: a
|
|
425
|
+
}) : null, /* @__PURE__ */ D("div", {
|
|
426
|
+
className: "md-alert-body local-alert-body",
|
|
427
|
+
children: r.render()
|
|
428
|
+
})]
|
|
429
|
+
})] });
|
|
430
|
+
}
|
|
431
|
+
function V(e) {
|
|
432
|
+
let n = u(e), r = i(e), { tone: a, error: o } = t(e, "tone", [
|
|
433
|
+
"neutral",
|
|
434
|
+
"success",
|
|
435
|
+
"warning"
|
|
436
|
+
], "neutral"), s = _(r.content);
|
|
437
|
+
return /* @__PURE__ */ O(E, { children: [o ? /* @__PURE__ */ D(p, { message: r.t("Invalid tone; using the default style", "色调无效,已使用默认样式") }) : null, /* @__PURE__ */ D("span", {
|
|
438
|
+
className: `md-badge md-badge-${a} local-badge`,
|
|
439
|
+
...n(s ? { color: s } : void 0),
|
|
440
|
+
children: /* @__PURE__ */ D("span", {
|
|
441
|
+
className: "md-badge-label",
|
|
442
|
+
children: r.renderInline()
|
|
443
|
+
})
|
|
444
|
+
})] });
|
|
445
|
+
}
|
|
446
|
+
function H(e) {
|
|
447
|
+
let t = u(e), n = i(e), r = C(), { mode: a, t: o } = n, s = d(e, "text", o("Tooltip", "提示")), [c, f] = T(!1), p = w(null), m = w(null), h = `${r}-tooltip`, g = c && e.visible && a !== "static";
|
|
448
|
+
return y(m, g), S(() => f(!1), [
|
|
449
|
+
e.visible,
|
|
450
|
+
e.resetToken,
|
|
451
|
+
a
|
|
452
|
+
]), b(() => {
|
|
453
|
+
let e = m.current, t = p.current;
|
|
454
|
+
if (!g || !e || !t) return;
|
|
455
|
+
let n = () => {
|
|
456
|
+
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = Number.parseFloat(getComputedStyle(e).getPropertyValue("--space-2")) || 8, a = Math.max(8, Math.min(r.left, window.innerWidth - n.width - 8)), o = r.top - n.height - i, s = o >= 8 ? o : Math.max(8, Math.min(r.bottom + i, window.innerHeight - n.height - 8));
|
|
457
|
+
e.style.left = `${a}px`, e.style.top = `${s}px`;
|
|
458
|
+
};
|
|
459
|
+
n(), window.addEventListener("resize", n), window.addEventListener("scroll", n, {
|
|
460
|
+
capture: !0,
|
|
461
|
+
passive: !0
|
|
462
|
+
});
|
|
463
|
+
let r = new ResizeObserver(n);
|
|
464
|
+
return r.observe(t), r.observe(e), () => {
|
|
465
|
+
window.removeEventListener("resize", n), window.removeEventListener("scroll", n, !0), r.disconnect();
|
|
466
|
+
};
|
|
467
|
+
}, [g, s]), a === "static" ? /* @__PURE__ */ O("span", {
|
|
468
|
+
...t(),
|
|
469
|
+
className: "local-tooltip local-static-tooltip",
|
|
470
|
+
children: [/* @__PURE__ */ D("span", {
|
|
471
|
+
className: "local-tooltip-trigger",
|
|
472
|
+
children: n.renderInline()
|
|
473
|
+
}), /* @__PURE__ */ D("span", {
|
|
474
|
+
className: "md-tooltip local-tooltip-bubble is-visible",
|
|
475
|
+
role: "note",
|
|
476
|
+
children: s
|
|
477
|
+
})]
|
|
478
|
+
}) : /* @__PURE__ */ O("span", {
|
|
479
|
+
...t(),
|
|
480
|
+
className: "local-tooltip",
|
|
481
|
+
onMouseEnter: () => f(!0),
|
|
482
|
+
onMouseLeave: () => f(!1),
|
|
483
|
+
children: [
|
|
484
|
+
/* @__PURE__ */ D("span", {
|
|
485
|
+
className: "local-tooltip-trigger",
|
|
486
|
+
ref: p,
|
|
487
|
+
tabIndex: 0,
|
|
488
|
+
"aria-describedby": h,
|
|
489
|
+
onFocus: () => f(!0),
|
|
490
|
+
onBlur: () => f(!1),
|
|
491
|
+
onKeyDown: (e) => {
|
|
492
|
+
e.key === "Escape" && (e.stopPropagation(), f(!1));
|
|
493
|
+
},
|
|
494
|
+
children: n.renderInline()
|
|
495
|
+
}),
|
|
496
|
+
/* @__PURE__ */ D("span", {
|
|
497
|
+
id: h,
|
|
498
|
+
ref: m,
|
|
499
|
+
role: "tooltip",
|
|
500
|
+
popover: "manual",
|
|
501
|
+
className: `md-tooltip local-tooltip-bubble${g ? " is-visible" : ""}`,
|
|
502
|
+
children: s
|
|
503
|
+
}),
|
|
504
|
+
/* @__PURE__ */ D(l, { value: s })
|
|
505
|
+
]
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
function U(e) {
|
|
509
|
+
let t = u(e), r = i(e), o = C(), { content: s, mode: c, t: l } = r, d = `${o}-jump-feedback`, [f, p] = T(null), m = n(s, "to") ?? "", g = r.navigation.targetId(m), v = n(s, "appearance") === "button" ? "button" : "link", y = _(s), b = g ? `#${g}` : "#", x = g !== void 0 && r.navigation.allowed(m);
|
|
510
|
+
if (a(e, () => p(null)), c === "static") return x && g ? /* @__PURE__ */ D("a", {
|
|
511
|
+
href: `#${g}`,
|
|
512
|
+
className: "local-jump local-jump-link local-jump-static",
|
|
513
|
+
...t(h(y)),
|
|
514
|
+
children: r.renderInline()
|
|
515
|
+
}) : /* @__PURE__ */ D("span", {
|
|
516
|
+
className: "local-jump local-jump-static-blocked",
|
|
517
|
+
...t(h(y)),
|
|
518
|
+
children: r.renderInline()
|
|
519
|
+
});
|
|
520
|
+
let S = (e) => {
|
|
521
|
+
if (!x || !g) {
|
|
522
|
+
e.preventDefault(), p(g ? l("Jump is blocked by the host", "跳转已被主机策略阻止") : l("Jump target not found", "找不到跳转目标"));
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
if (e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
|
|
526
|
+
let t = r.navigation.jump(m);
|
|
527
|
+
t === "missing" ? (e.preventDefault(), p(l("Jump target not found", "找不到跳转目标"))) : t === "hidden" ? (e.preventDefault(), p(l("Jump target is hidden", "跳转目标当前隐藏"))) : (e.preventDefault(), p(null));
|
|
528
|
+
};
|
|
529
|
+
return /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D("a", {
|
|
530
|
+
href: x ? b : "#",
|
|
531
|
+
className: v === "button" ? "local-jump local-jump-button md-button md-button-secondary" : "local-jump local-jump-link",
|
|
532
|
+
...t(h(y)),
|
|
533
|
+
"data-local-custom-color": y ? "true" : void 0,
|
|
534
|
+
"data-local-target-missing": g ? void 0 : "true",
|
|
535
|
+
"data-local-jump-blocked": g && !x ? "true" : void 0,
|
|
536
|
+
"aria-describedby": f ? d : void 0,
|
|
537
|
+
onClick: S,
|
|
538
|
+
children: r.renderInline()
|
|
539
|
+
}), f ? /* @__PURE__ */ D("span", {
|
|
540
|
+
id: d,
|
|
541
|
+
className: "local-jump-feedback",
|
|
542
|
+
role: "status",
|
|
543
|
+
"aria-live": "polite",
|
|
544
|
+
children: f
|
|
545
|
+
}) : null] });
|
|
546
|
+
}
|
|
547
|
+
function W(e) {
|
|
548
|
+
let t = u(e), n = i(e).navigation.anchorId();
|
|
549
|
+
return n ? /* @__PURE__ */ D("span", {
|
|
550
|
+
...t(),
|
|
551
|
+
className: "local-anchor",
|
|
552
|
+
id: n,
|
|
553
|
+
"data-local-anchor": ""
|
|
554
|
+
}) : null;
|
|
555
|
+
}
|
|
556
|
+
function G(t) {
|
|
557
|
+
let r = u(t), a = i(t), o = x(v), s = _(a.content), c = n(a.content, "size"), l = c === void 0 ? void 0 : e(c), d = n(a.content, "font"), f = d && o && Object.hasOwn(o, d) ? o[d] : void 0, p = f === void 0 ? void 0 : `"${f}", var(--font-sans, sans-serif)`;
|
|
558
|
+
return /* @__PURE__ */ D("span", {
|
|
559
|
+
className: "local-text",
|
|
560
|
+
"data-text-size": l === void 0 ? c : void 0,
|
|
561
|
+
"data-text-font": d,
|
|
562
|
+
...r(s || l !== void 0 || p ? {
|
|
563
|
+
color: s,
|
|
564
|
+
fontSize: l,
|
|
565
|
+
fontFamily: p
|
|
566
|
+
} : void 0),
|
|
567
|
+
children: a.renderInline()
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
function K(e) {
|
|
571
|
+
let t = u(e), n = i(e), r = _(n.content);
|
|
572
|
+
return /* @__PURE__ */ D("div", {
|
|
573
|
+
className: "local-section",
|
|
574
|
+
...t(r ? { color: r } : void 0),
|
|
575
|
+
children: n.render()
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
function q(e) {
|
|
579
|
+
let t = u(e), n = i(e), r = e.validation.hintFor(e.content);
|
|
580
|
+
if (!r) return null;
|
|
581
|
+
let a = r.failed || r.error, o = n.visible && a;
|
|
582
|
+
return /* @__PURE__ */ D("span", {
|
|
583
|
+
...t(),
|
|
584
|
+
id: r.id,
|
|
585
|
+
className: "local-validation-hint",
|
|
586
|
+
"data-local-validation": r.error ? "error" : r.failed ? "failed" : "passed",
|
|
587
|
+
role: o ? "status" : void 0,
|
|
588
|
+
"aria-live": o ? "polite" : void 0,
|
|
589
|
+
children: a ? r.message : null
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
export { G as _, A as a, j as c, k as d, K as f, N as g, M as h, V as i, R as l, P as m, B as n, L as o, F as p, W as r, z as s, I as t, U as u, H as v, q as y };
|