@nxgt/material 3.60.0 → 3.63.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.md +44 -0
- package/README.md +3 -2
- package/dist/alert-dialog-RHm6WtQj.js +189 -0
- package/dist/{async-slice-HJY_VJjD.js → async-slice-DmX59NyA.js} +3 -4
- package/dist/{button-7BuUCGRm.js → button-DfS_amfQ.js} +1 -1
- package/dist/charts.js +3 -3
- package/dist/{chip-kQOrHlDX.js → chip-Cbndukko.js} +2 -2
- package/dist/{code-editor-Ckc9TTCM.js → code-editor-B0tN8Ha_.js} +11 -11
- package/dist/code-editor.js +54 -37
- package/dist/{code-language-items-rCPB0Xee.js → code-language-items-andgHKrM.js} +2 -2
- package/dist/components/ui/layout/sidebar/sidebar-tokens.css +13 -1
- package/dist/{components-BSM-h5IQ.js → components-Cm2doOJS.js} +13090 -12957
- package/dist/components.js +28 -26
- package/dist/dialog-Bd7Hid2L.js +219 -0
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-CiobN1wi.js → dropdown-menu-_SyVmSuy.js} +1 -1
- package/dist/editor.js +707 -706
- package/dist/{empty-state-DA517HAb.js → empty-state-D-2ZMXXJ.js} +2 -2
- package/dist/escape-owner-DpaP0lm1.js +19 -0
- package/dist/{field-blur-DdvY0NQQ.js → field-blur-DyOByjzw.js} +1 -1
- package/dist/{field-blur-context-DbJQZkEB.js → field-blur-context-DPe5_Nv5.js} +1 -1
- package/dist/hooks-a7_exKWS.js +329 -0
- package/dist/hooks.js +8 -102
- package/dist/{hover-card-DPs9huSs.js → hover-card-D_0smKBQ.js} +2 -2
- package/dist/i18n.js +8 -10
- package/dist/{icon-badge-C646JTOI.js → icon-badge-CBCU3ySF.js} +14 -14
- package/dist/{icon-button-DvP0Gy3j.js → icon-button-hKHsWTAt.js} +1 -1
- package/dist/illustrations-game.js +2 -0
- package/dist/lib/components/ui/display/list-tile/list-tile.d.ts +6 -0
- package/dist/lib/components/ui/display/list-tile/partials/list-tile-classes.d.ts +3 -1
- package/dist/lib/components/ui/display/list-tile/partials/list-tile-line.d.ts +1 -1
- package/dist/lib/components/ui/display/list-tile/partials/list-tile-toggle.d.ts +1 -1
- package/dist/lib/components/ui/feedback/index.d.ts +1 -0
- package/dist/lib/components/ui/feedback/unsaved-dialog/index.d.ts +1 -0
- package/dist/lib/components/ui/feedback/unsaved-dialog/unsaved-dialog.d.ts +20 -0
- package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
- package/dist/lib/components/ui/fields/textarea-field/textarea-footer.d.ts +2 -1
- package/dist/lib/components/ui/layout/app-shell/activity-layout.types.d.ts +6 -3
- package/dist/lib/components/ui/layout/app-shell/index.d.ts +1 -1
- package/dist/lib/components/ui/layout/app-shell/route-transition.d.ts +20 -2
- package/dist/lib/components/ui/layout/app-shell/shapes-clear-content.d.ts +2 -1
- package/dist/lib/components/ui/widgets/code-editor/configure-monaco.d.ts +2 -0
- package/dist/lib/components/ui/widgets/education/questions/index.d.ts +3 -1
- package/dist/lib/components/ui/widgets/education/questions/partials/question-content.d.ts +1 -1
- package/dist/lib/components/ui/widgets/education/questions/partials/question-top.d.ts +6 -0
- package/dist/lib/components/ui/widgets/education/questions/question-long-text.d.ts +5 -0
- package/dist/lib/components/ui/widgets/education/questions/question-media-content.d.ts +24 -0
- package/dist/lib/components/ui/widgets/education/questions/question-media-helpers.d.ts +11 -0
- package/dist/lib/components/ui/widgets/education/questions/question-media-view.d.ts +18 -0
- package/dist/lib/components/ui/widgets/education/questions/question-media-view.types.d.ts +32 -0
- package/dist/lib/components/ui/widgets/education/questions/question-options.d.ts +2 -2
- package/dist/lib/components/ui/widgets/education/questions/question-text.d.ts +1 -1
- package/dist/lib/components/ui/widgets/education/questions/question.d.ts +1 -1
- package/dist/lib/components/ui/widgets/education/questions/types.d.ts +38 -1
- package/dist/lib/components/ui/widgets/education/questions/use-reload-focus.d.ts +13 -0
- package/dist/lib/hooks/drafts-store.d.ts +4 -0
- package/dist/lib/hooks/index.d.ts +4 -0
- package/dist/lib/hooks/unsaved-guard-rules.d.ts +30 -0
- package/dist/lib/hooks/use-drafts.d.ts +75 -0
- package/dist/lib/hooks/use-react-router-block.d.ts +11 -0
- package/dist/lib/hooks/use-unsaved-guard/guard-core.d.ts +30 -0
- package/dist/lib/hooks/use-unsaved-guard/index.d.ts +3 -0
- package/dist/lib/hooks/use-unsaved-guard/types.d.ts +63 -0
- package/dist/lib/hooks/use-unsaved-guard/use-discard-guard.d.ts +15 -0
- package/dist/lib/hooks/use-unsaved-guard/use-unsaved-guard.d.ts +19 -0
- package/dist/lib/i18n/resources/en/en.d.ts +20 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +21 -1
- package/dist/lib/i18n/resources/fr/fr.d.ts +20 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +21 -1
- package/dist/lib/i18n/resources/resources.d.ts +40 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib/illustrations-game/index.d.ts +17 -0
- package/dist/lib.js +1 -1
- package/dist/main.js +42 -43
- package/dist/map.js +63 -63
- package/dist/material.css +1 -1
- package/dist/pdf-reader.js +1 -1
- package/dist/print.js +1 -2
- package/dist/{public-BYsrhyPW.js → public-D8JGp3PH.js} +823 -822
- package/dist/{rich-code-block-WJxDWPPY.js → rich-code-block-0R3bidsM.js} +5 -5
- package/dist/{sortable-provider-oPjlhlZo.js → sortable-provider-B75v53sB.js} +2 -2
- package/dist/{spinner-C5lObWXT.js → spinner-CAnpF3RK.js} +1 -1
- package/dist/theme-picker.js +2 -2
- package/dist/{theme-toggle-CPEq5JG-.js → theme-toggle-pQ5F602V.js} +1 -1
- package/dist/{toolbar-items-ByvXcMHm.js → toolbar-items-_ezD5B0r.js} +4 -4
- package/dist/translate-material-CvZK8_S6.js +96 -0
- package/dist/{stored-language-B-tiWZU2.js → translator-Caf-d96e.js} +2497 -8
- package/dist/{escape-owner-r57kuPjn.js → typography-CEK19bj8.js} +17 -34
- package/dist/{use-chat-composer-CzOVaIed.js → use-chat-composer-Dpvi_-CR.js} +5164 -5338
- package/dist/{use-heading-spy-BOtygPFu.js → use-heading-spy-mmcyEGmm.js} +186 -71
- package/dist/{use-material-translation-B5j3jZs7.js → use-material-translation-C_1cWRzW.js} +1 -2
- package/dist/use-return-focus-1ZIchrBM.js +269 -0
- package/docs/components/data-display.md +1 -0
- package/docs/components/feedback-and-status.md +23 -0
- package/docs/components/navigation-and-layout.md +5 -4
- package/docs/components/rich-widgets.md +73 -1
- package/docs/guides/app-shell.md +17 -0
- package/docs/guides/code-editor.md +8 -0
- package/docs/guides/csp.md +4 -0
- package/docs/guides/helpers.md +120 -0
- package/docs/guides/icon-motifs.md +3 -1
- package/docs/guides/illustrations.md +33 -1
- package/docs/guides/migrating-to-3.md +4 -2
- package/docs/guides/theming.md +13 -3
- package/docs/previews/feedback-status-illustration-game.webp +0 -0
- package/docs/previews/feedback-status-unsaveddialog.webp +0 -0
- package/docs/roadmap.md +1 -1
- package/docs/troubleshooting.md +9 -6
- package/lib/components/ui/layout/sidebar/sidebar-tokens.css +13 -1
- package/package.json +7 -2
- package/dist/dialog-yfPkLqUQ.js +0 -482
- package/dist/i18n-provider-BehR6cU7.js +0 -79
- package/dist/translate-material-tUaLZUmT.js +0 -20
- package/dist/translator-B9XjUDRu.js +0 -2451
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
1
1
|
# @nxgt/material
|
|
2
2
|
|
|
3
|
+
## 3.63.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#2016](https://github.com/softistx/nxgt-material/pull/2016) [`ee0f79a`](https://github.com/softistx/nxgt-material/commit/ee0f79ae125d4154c043c1700276de57fee0a7df) Thanks [@SteveGT96](https://github.com/SteveGT96)! - `QuestionCard`: open and code answers. `Question.kind` gains `'open'` (a multi-line answer in a textarea, with a counter when `question.maxLength` is set) and `'code'` (source code). The card keeps its prompt, number, media, hint and verdict frame, and the field is named by the prompt. New props: `readOnly` (an answer already submitted, shown without the revealed marks), `busy` (read-only and `aria-busy` while saving), both honoured by every kind (choice, multi, boolean, text, number too, locked without the revealed marks) and `renderCode`, a slot that draws the `code` field from a `QuestionCodeField` (`value`, `onChange`, `label`, `labelledBy`, `language`, `maxLength`, `readOnly`, `disabled`), for example with `CodeEditor` from `@nxgt/material/code-editor`; Monaco stays out of the `QuestionCard` bundle, and without `renderCode` the field is a monospace textarea. `Question` gains `maxLength` and `language`. `open` and `code` have no `correct`: pass the grader's `verdict`. New strings: `material.education.kind-open`, `kind-code`, `code-placeholder` (English and French). Additive ([#2000](https://github.com/softistx/nxgt-material/issues/2000)).
|
|
8
|
+
|
|
9
|
+
`TextareaField`: the character count now has an id joined into the textarea's `aria-describedby`, and is announced politely (`role="status"`) only within 10% of `maxLength`.
|
|
10
|
+
|
|
11
|
+
- [#2018](https://github.com/softistx/nxgt-material/pull/2018) [`41931d0`](https://github.com/softistx/nxgt-material/commit/41931d061b05d17c8da907516d016cbd24262191) Thanks [@SteveGT96](https://github.com/SteveGT96)! - `QuestionMediaView`: a question's file, picked by its content type. `media` has the shape of `Question.media` plus `size?` (`src`, `type`, `alt?`, `name?`, `kind?`), so `question.media` goes straight in: an image with its `alt` (else a generic name), an `AudioPlayer`, a `<video controls>` (with optional `captions` tracks), and any other type (a PDF) as an open-in-a-new-tab link showing the file type and size, which fetches nothing (no `connect-src` or bucket CORS needed); `documents="preview"` draws a `FilePreview` instead. When the file fails to load (an expired presigned link) an alert says so, with a Reload button when `onReload` is passed (`reloading` shows it busy); a new `src` is a new chance. Named `QuestionMediaView` because `QuestionMedia` is already the type of `Question.media`. After a Reload that works, focus moves to the file when it was on the button. New strings: `material.question-media.*` (English and French). Additive ([#2001](https://github.com/softistx/nxgt-material/issues/2001)).
|
|
12
|
+
|
|
13
|
+
- [#2024](https://github.com/softistx/nxgt-material/pull/2024) [`62c6a40`](https://github.com/softistx/nxgt-material/commit/62c6a4017c929de5b5da374ce03348729658f893) Thanks [@SteveGT96](https://github.com/SteveGT96)! - feat(sidebar): add `--sidebar-active-edge`, the colour of the active entry's start bar (`bg-sidebar-active-edge`). It defaults to `--sidebar-active-foreground`, so nothing changes unless a theme sets it, and then only the bar changes.
|
|
14
|
+
|
|
15
|
+
- [#2022](https://github.com/softistx/nxgt-material/pull/2022) [`7eb67b3`](https://github.com/softistx/nxgt-material/commit/7eb67b30ee88516e33649b2101d278554ac90625) Thanks [@SteveGT96](https://github.com/SteveGT96)! - Add the unsaved-changes guard ([#1658](https://github.com/softistx/nxgt-material/issues/1658)). `useUnsavedGuard(dirty, { block, leaves?, ignoreSearch?, onBlock? })` in `@nxgt/material/hooks` blocks in-app navigation while a form is dirty and guards `beforeunload`; it returns `{ release, dialog }` (`release()` is synchronous and one-shot: the next navigation that really leaves passes, then the guard re-arms, and a release no navigation used expires when the current task ends; call it before the navigation that follows a save). The router is injected through a `block` adapter, `useReactRouterBlock` being the ready one for React Router. By default a pathname or query-string change is a leave; `ignoreSearch` or a `leaves(current, next)` predicate changes that, and `onBlock()` can flush pending saves and let the navigation through silently. `dirty` may be a function read at block time. `useDiscardGuard(dirty)` returns `{ close(action), dialog }` for a form in a dialog or sheet. New `UnsavedDialog` component (`material.unsaved.*` keys, en and fr). No Vue twin yet ([#2019](https://github.com/softistx/nxgt-material/issues/2019)).
|
|
16
|
+
|
|
17
|
+
## 3.62.0
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- [#2011](https://github.com/softistx/nxgt-material/pull/2011) [`688d543`](https://github.com/softistx/nxgt-material/commit/688d543e3306e3709d66cd75f4ad64cea43d48d0) Thanks [@SteveGT96](https://github.com/SteveGT96)! - Add `inset` to `ListTile`. With `variant="divided"`, `inset` gives 16px of inline padding (M3's list-item inset) in place of 4px, for a divided list inside a `Card`; the hairlines still run edge to edge. Default `false`: nothing changes for existing tiles.
|
|
22
|
+
|
|
23
|
+
## 3.61.0
|
|
24
|
+
|
|
25
|
+
### Minor Changes
|
|
26
|
+
|
|
27
|
+
- [#1999](https://github.com/softistx/nxgt-material/pull/1999) [`cf43f97`](https://github.com/softistx/nxgt-material/commit/cf43f97b8e66f162486066a94d566a3faac25eaf) Thanks [@SteveGT96](https://github.com/SteveGT96)! - New subpath `@nxgt/material/illustrations/game`: a set of eleven game scenes (`night-sky`, `village`, `seer`, `healer`, `archer`, `cupid`, `wolf`, `victory`, `empty-table`, `waiting-players`, `connection-lost`) for a game, quiz, community or event app, registered like the health and education sets (`<IllustrationDefaults sets={[GAME_SCENES]}>`). Decorative by default, an accessible `title` on request, theme tones in light and dark. Importing it adds the ids to `SceneId`. Fixes [#1914](https://github.com/softistx/nxgt-material/issues/1914).
|
|
28
|
+
|
|
29
|
+
- [#1998](https://github.com/softistx/nxgt-material/pull/1998) [`02ff46a`](https://github.com/softistx/nxgt-material/commit/02ff46ad89404eba69d34ab3c6ec5e5b6cd92688) Thanks [@SteveGT96](https://github.com/SteveGT96)! - `ActivityLayout`'s default `routeTransition` (`true`) now fades the content region only when the pathname changes. A search or hash change (`?tab=`, a list search), a fetcher submit and a revalidation no longer animate the whole region, and typing in a search inside a dialog no longer drops characters. An explicit `routeTransition` object keeps working exactly as before, without the gate, so `{ default: 'nxgt-route' }` still animates every transition. If your app gated `update` on the pathname with a ref of the last pathname, remove that workaround.
|
|
30
|
+
|
|
31
|
+
New export `ROUTE_TRANSITION_CLASS` (`'nxgt-route'`), so a nested `<ViewTransition>` fades with the same timing as the shell.
|
|
32
|
+
|
|
33
|
+
- [#2007](https://github.com/softistx/nxgt-material/pull/2007) [`815f539`](https://github.com/softistx/nxgt-material/commit/815f5399630ca494edc7879f365a80e77b61bd6e) Thanks [@SteveGT96](https://github.com/SteveGT96)! - Add `useDrafts(storageKey, options?)` to `@nxgt/material/hooks`: unsent values kept by key in the tab's `sessionStorage` so a reload or a jump to another step of a form loses no typed text. It returns `{ get, set, drop, clear, keys, loaded }`, reads after the first render (no hydration mismatch), swallows storage errors, and takes `serialize`, `parse` and `storage` options. Call `drop(key)` once the value is saved. `clearDrafts(storageKey, storage?)` empties a store key without a hook (sign-out). No Vue twin yet.
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- [#1995](https://github.com/softistx/nxgt-material/pull/1995) [`224da3b`](https://github.com/softistx/nxgt-material/commit/224da3b885e346aa627a471b124d88750042abda) Thanks [@SteveGT96](https://github.com/SteveGT96)! - Fix backdrop shapes cut by the edge of a surface. With `ActivityLayout`'s shapes backdrop, a glyph that straddled the edge of a header band (`ActivityContentHeader`, `EntityHeader`, the breadcrumb) or of a plain `bg-card` block was drawn half hidden. The keep-clear rule now counts those blocks whole, so a glyph meeting a surface edge is dropped whole, like one that meets a card. An element with the bare `bg-card` class now counts as a surface, so a page-wide `bg-card` wrapper keeps every glyph clear.
|
|
38
|
+
|
|
39
|
+
- [#2006](https://github.com/softistx/nxgt-material/pull/2006) [`c723507`](https://github.com/softistx/nxgt-material/commit/c723507e4ca28f73d76869862bd371a46e2c7930) Thanks [@SteveGT96](https://github.com/SteveGT96)! - `configureMonaco` (`@nxgt/material/code-editor`) gives the `<style>` elements Monaco injects the page's CSP nonce (`getCspNonce()`), so a `style-src-elem 'nonce-…'` policy no longer refuses the editor's styles and an app needs no `document.createElement` patch. The code editor and CSP guides say how the nonce and the bundled workers fit together. Fixes [#2002](https://github.com/softistx/nxgt-material/issues/2002).
|
|
40
|
+
|
|
41
|
+
- [#1996](https://github.com/softistx/nxgt-material/pull/1996) [`5dbe8cc`](https://github.com/softistx/nxgt-material/commit/5dbe8ccd3f765879698bb4880fa0603cb1d9b177) Thanks [@SteveGT96](https://github.com/SteveGT96)! - `ActivityLayout` and `AppHeader` no longer show the phone's menu button when the menu sheet would hold nothing to open: `items` is empty and there is no `context` line. The brand alone does not count. A menu with any entry (footer ones included) or a `context` keeps its button, and `showMenuIcon={false}` still hides it. Fixes [#1418](https://github.com/softistx/nxgt-material/issues/1418).
|
|
42
|
+
|
|
43
|
+
- [#2013](https://github.com/softistx/nxgt-material/pull/2013) [`c4b4a4d`](https://github.com/softistx/nxgt-material/commit/c4b4a4d20e05b1f3e3e2c6052b98513b4fcb9633) Thanks [@SteveGT96](https://github.com/SteveGT96)! - `QuestionCard`: in the answer key, the correct option of an unanswered single-choice question is drawn with the dashed `missed` style, as multi-choice does, instead of the solid `correct` one. A chosen correct option stays `correct`. Fixes [#2010](https://github.com/softistx/nxgt-material/issues/2010).
|
|
44
|
+
- Updated dependencies [[`cf43f97`](https://github.com/softistx/nxgt-material/commit/cf43f97b8e66f162486066a94d566a3faac25eaf)]:
|
|
45
|
+
- @nxgt/material-core@0.44.0
|
|
46
|
+
|
|
3
47
|
## 3.60.0
|
|
4
48
|
|
|
5
49
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -208,6 +208,7 @@ reads `duotone.svg`, the file that exists (it used to ask for the missing
|
|
|
208
208
|
| `@nxgt/material/illustrations` | State illustrations: `Illustration` (`scene`: `empty`, `no-results`, `not-found`, `error`, `offline`, `success`, `welcome`, `forbidden`, `maintenance`, `invitation`, `sign-in`, `empty-inbox`, or an id of the `scenes` table it is given; `size`, `title`, `animated`, `hero`, `satellites`, `iconStyle`, `tone`, `duotone`) draws a hero icon on a Material 3 Expressive plate with satellites, from the Font Awesome sprites your app serves (no icon artwork ships); `IllustrationDefaults` (`icons`: `'suggested'` or a table, `iconStyle`, `sets`) opts a subtree's `EmptyState` and `ErrorState` into them; `ILLUSTRATION_SCENES`, `SUGGESTED_ICONS` and the types re-exported from `@nxgt/material-core/illustrations` (`SceneRow`, `SceneTable`), plus `IconStyleInput` and `IconStyleRef` (the `iconStyle` types: `{ family?, type? }` or one of the 37 sprite file names), `SceneId`, `RegisteredScene` and `IllustrationSceneRegistry`, the scene id type that an imported set's ids widen. `unauthorized` and `maintenance` states draw the `forbidden` and `maintenance` scenes. `EmptyState`, `ErrorState` and the `DataTable` empty row (`emptyIllustration`) also take `illustration` as a scene id or `true`. Colours are theme tones in `styles.css`; its own entry ([illustrations guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/illustrations.md)) |
|
|
209
209
|
| `@nxgt/material/illustrations/health` | The health scenes: `HEALTH_SCENES` (`patient-record`, `consultation`, `appointment`, `lab-sample`, `prescription`, `vaccination`, `hospitalisation`, `emergency`, `no-patients`, `lab-results`), `HEALTH_SCENE_IDS`, `HEALTH_SUGGESTED_ICONS`, `HealthScene`; register it with `<IllustrationDefaults sets={[HEALTH_SCENES]}>` so `<Illustration scene="patient-record" />` and `<EmptyState illustration="no-patients" />` work (or pass `scenes={HEALTH_SCENES}` to one `Illustration`); importing it adds the ids to `SceneId`. An app that does not import it does not carry it |
|
|
210
210
|
| `@nxgt/material/illustrations/education` | The education scenes: `EDUCATION_SCENES` (`classroom`, `homework`, `exam-grades`, `timetable`, `attendance`, `enrolment`, `library`, `graduation`, `no-students`, `report-card`), `EDUCATION_SCENE_IDS`, `EDUCATION_SUGGESTED_ICONS`, `EducationScene`; register it with `<IllustrationDefaults sets={[EDUCATION_SCENES]}>` so `<Illustration scene="classroom" />` and `<EmptyState illustration="no-students" />` work (or pass `scenes={EDUCATION_SCENES}` to one `Illustration`); importing it adds the ids to `SceneId`. An app that does not import it does not carry it |
|
|
211
|
+
| `@nxgt/material/illustrations/game` | The game scenes, for a game, quiz, community or event app: `GAME_SCENES` (`night-sky`, `village`, `seer`, `healer`, `archer`, `cupid`, `wolf`, `victory`, `empty-table`, `waiting-players`, `connection-lost`), `GAME_SCENE_IDS`, `GAME_SUGGESTED_ICONS`, `GameScene`; register it with `<IllustrationDefaults sets={[GAME_SCENES]}>` so `<Illustration scene="village" />` and `<EmptyState illustration="empty-table" />` work (or pass `scenes={GAME_SCENES}` to one `Illustration`); importing it adds the ids to `SceneId`. Pass `title` for an accessible name, otherwise the picture is decorative (`aria-hidden`). An app that does not import it does not carry it |
|
|
211
212
|
| `@nxgt/material/backgrounds` | Background presets: `Background` (a superset of the `/components` one: `preset`, `animated`, `grain`, `seed`, `fill`, `motif`, and for `preset="icons"` `icons`, `iconStyle` and `iconMotif`), `AVAILABLE_BACKGROUND_PRESETS` and `AvailableBackgroundPreset` (the 50 ids `Background` draws), `MoonOptions` (the `moon` prop), `IconMotifOptions` (`iconMotif`, with `quiet`: a band the icons fade out of for text), `IconLayout`, `IconQuiet`, `SkyPreset` and `CelestialPreset` (the `sky` ids), `IconsInput` (`icons`), `IconStyleInput` and `IconStyleRef` (`iconStyle`: `{ family?, type? }` or one of the 37 sprite file names, completed by the editor, any other string is a type error), `sky` (`'moon'` or a celestial preset over any preset, also read from the theme's `background.sky`; the four celestial presets and `sky` share the opt-in `@nxgt/material/backgrounds/celestial.css`, also in `backgrounds.css`), `MOTIF_SHAPES_ALL` (the 25 motif shapes), the `MotifLayout` type, the types and tables (`BACKGROUND_PRESETS`, `BACKGROUND_TONES`, ...) re-exported from `@nxgt/material-core/backgrounds`; its own entry, with an opt-in stylesheet ([backgrounds guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/backgrounds.md)) |
|
|
212
213
|
| `@nxgt/material/editor` | The rich text editor: `DocumentEditor` and `DocumentEditorFormField` (with an `outline`, a block handle, focus mode, find and replace, `onUpload`, `onAssist` and `comments`), `CompactEditor` and `CompactEditorFormField`, `RichChatComposer`, `EditorRoot` and the parts (`EditorToolbar`, `EditorContent`, `EditorFooter`, `EditorAssistantPanel`, ...), `useEditor`, the kits (`documentKit`, `compactKit`, `chatKit`, `formNodesKit`), `withFeatures` / `withoutFeatures` and `defineFeature`, and the converters `toHtml`, `toJson`, `toMarkdown`, `fromMarkdown` and `looksLikeMarkdown` — **its own entry, and not in the barrel above**. **Client-only**: import it from a `'use client'` file; `/editor/viewer` is the server-safe one. The `.nxgt-prose` page styles ship in `styles.css` with the component CSS ([DocumentEditor](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/rich-widgets.md#documenteditor)) |
|
|
213
214
|
| `@nxgt/material/editor/viewer` | `RichTextViewer`: shows a saved document (HTML, JSON or Markdown) read-only, **server-safe**, with no editor instance and no `'use client'` ([RichTextViewer](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/rich-widgets.md#richtextviewer)) |
|
|
@@ -219,7 +220,7 @@ reads `duotone.svg`, the file that exists (it used to ask for the missing
|
|
|
219
220
|
| `@nxgt/material/draw/png` | `drawingToPng(sceneOrSvg, { scale?, background?, colorsFrom? })` and `downloadDrawingPng(source, fileName)` — a drawing (a scene, or a live `<svg>` such as `svgRef.current` of a `<Drawing ref={svgRef}>`) as a PNG `Blob` in the browser, with the page's theme colours resolved, `data:` images inlined and CORS errors named; its own entry, DOM only when called ([drawing guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/drawing.md#png), [reference](https://cdn.jsdelivr.net/npm/@nxgt/material-core@0/docs/draw.md#png-nxgtmaterial-coredrawpng)) |
|
|
220
221
|
| `@nxgt/material/vite` | build-time helpers for consumers: `nxgtMaterial()` (a strict CSP by hash or nonce, self-hosted fonts, a styles check, serves the pdf.js worker on the Vite 5–7 dev server, generates your app themes' stylesheets with `nxgtMaterial({ themes })` and the `nxgt-theme` bin: [Themes guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/themes.md), a reduced backdrop icon sprite from your Font Awesome install with `nxgtMaterial({ backdropSprite })` and the `nxgt-backdrop-sprite` bin, PDFs on a bundled server with `nxgtMaterial({ pdf: { bundle: true } })`: [Vite plugin guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/vite-plugin.md)), `pdfkitStandardFonts()` ([printing guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/printing.md)), `cspAssetsInlineLimit`, a `build.assetsInlineLimit` that never inlines a font ([CSP guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/csp.md#katex-fonts)) |
|
|
221
222
|
| `@nxgt/material/next` | `withNxgtPrint(nextConfig)`: the `next.config.ts` a Next.js route handler that imports `/print` needs, `output: 'standalone'` included. Node only, no dependency on `next` ([printing guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/printing.md#nextjs-serverexternalpackages-and-output-standalone)) |
|
|
222
|
-
| `@nxgt/material/hooks` | `useTheme`, `useIsClient`, `useIsMobile`, `useLocalizedDate`, `useCspNonce`, `useFocusOnMount`, `useCountdown`, `useSubmitOnce`, … ([helpers](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/helpers.md#nxgtmaterialhooks)) |
|
|
223
|
+
| `@nxgt/material/hooks` | `useTheme`, `useIsClient`, `useIsMobile`, `useLocalizedDate`, `useCspNonce`, `useFocusOnMount`, `useCountdown`, `useSubmitOnce`, `useDrafts`, `useUnsavedGuard`, … ([helpers](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/helpers.md#nxgtmaterialhooks)) |
|
|
223
224
|
| `@nxgt/material/dnd` | `@dnd-kit` primitives ([helpers](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/helpers.md#nxgtmaterialdnd)) |
|
|
224
225
|
| `@nxgt/material/i18n` | `I18nProvider`, `mergeResources`, `createTranslator`, `translateMaterial`, `formatMessage` ([i18n guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/i18n.md)) |
|
|
225
226
|
| `@nxgt/material/lib` | `cn`, `clientOnly`, date, number and storage utilities, `useSliceReducer`, `getCspNonce` / `setCspNonce`, the server-side CSP helpers (`createCspNonce`, `cspPolicy`, `cspHash`, `applyCspNonce`, `CSP_NONCE_PLACEHOLDER`, `ZOD_JITLESS_SCRIPT`, `zodJitlessTag`: [CSP, SSR](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/csp.md#ssr)) ([helpers](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/helpers.md#nxgtmateriallib)) |
|
|
@@ -463,7 +464,7 @@ Each area a consumer starts from has its own page under `docs/guides/`.
|
|
|
463
464
|
| [Drawing](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/drawing.md) | drawing diagrams, badges and illustrations from code with `@nxgt/material/draw`: a scene or JSX, theme roles and tones, strict CSP, accessibility, events, sketch, animation, PNG, PDF and e-mail |
|
|
464
465
|
| [Barcodes](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/barcode.md) | Code 128 and Data Matrix with `@nxgt/material/barcode`: props, paper appearance, accessibility, `barcodeGeometry`, `LabelSheet` label sizes, offsets and `skip`, errors and printing |
|
|
465
466
|
| [Backgrounds](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/backgrounds.md) | tones, intensity, the opt-in `backgrounds.css` and per-preset files, custom tone tokens, motion and CSP |
|
|
466
|
-
| [Illustrations](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/illustrations.md) | `@nxgt/material/illustrations`: the twelve scenes and the health and
|
|
467
|
+
| [Illustrations](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/illustrations.md) | `@nxgt/material/illustrations`: the twelve scenes and the health, education and game sets, icons from your sprites, `EmptyState` / `ErrorState` / `DataTable` with `illustration`, `IllustrationDefaults` for an app, sizes, motion and CSP |
|
|
467
468
|
| [Icon motifs](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/icon-motifs.md) | icon backgrounds, celestial skies, illustrations and themes together: serving your own Font Awesome sprites (the package ships none), `IconSpritesProvider`, `icons` / `iconStyle` / `iconMotif`, `sky`, the health and education sets, a theme naming its motif, Free fallbacks for Pro-only names |
|
|
468
469
|
| [Media players](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/media.md) | `MediaPlayer`, `AudioPlayer`, playlists, chapters and transcript, sound that keeps playing across pages (`MediaPlayerHost`), the lightbox, HLS, CSP and keyboard |
|
|
469
470
|
| [Streaming (HLS)](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/media-streaming.md) | `hlsStreaming()` from `@nxgt/material/media-hls`, the optional `hls.js` peer, native HLS, the quality menu, the CSP worker line |
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { r as e } from "./rolldown-runtime-BFFgcFxR.js";
|
|
2
|
+
import { t } from "./utils-BLfntITJ.js";
|
|
3
|
+
import { o as n } from "./dist-DVRQkaTK.js";
|
|
4
|
+
import { c as r, s as i } from "./dist-lmHmz_bu.js";
|
|
5
|
+
import { t as a } from "./in-dialog-Vwkyp-M5.js";
|
|
6
|
+
import { a as o, c as s, d as c, i as l, l as u, n as d, o as f, r as p, s as m, t as h, u as g } from "./use-return-focus-1ZIchrBM.js";
|
|
7
|
+
import { i as _ } from "./escape-owner-DpaP0lm1.js";
|
|
8
|
+
import * as v from "react";
|
|
9
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
10
|
+
//#region ../../node_modules/@radix-ui/react-alert-dialog/dist/index.mjs
|
|
11
|
+
var x = /* @__PURE__ */ e({
|
|
12
|
+
Action: () => W,
|
|
13
|
+
AlertDialog: () => D,
|
|
14
|
+
AlertDialogAction: () => I,
|
|
15
|
+
AlertDialogCancel: () => R,
|
|
16
|
+
AlertDialogContent: () => N,
|
|
17
|
+
AlertDialogDescription: () => F,
|
|
18
|
+
AlertDialogOverlay: () => A,
|
|
19
|
+
AlertDialogPortal: () => k,
|
|
20
|
+
AlertDialogTitle: () => P,
|
|
21
|
+
AlertDialogTrigger: () => O,
|
|
22
|
+
Cancel: () => G,
|
|
23
|
+
Content: () => U,
|
|
24
|
+
Description: () => q,
|
|
25
|
+
Overlay: () => H,
|
|
26
|
+
Portal: () => V,
|
|
27
|
+
Root: () => z,
|
|
28
|
+
Title: () => K,
|
|
29
|
+
Trigger: () => B,
|
|
30
|
+
createAlertDialogScope: () => T
|
|
31
|
+
}), S = Object.defineProperty, C = (e, t) => S(e, "name", {
|
|
32
|
+
value: t,
|
|
33
|
+
configurable: !0
|
|
34
|
+
}), [w, T] = r("AlertDialog", [c]), E = c(), D = /* @__PURE__ */ C((e) => {
|
|
35
|
+
let { __scopeAlertDialog: t, ...n } = e;
|
|
36
|
+
return /* @__PURE__ */ y(p, {
|
|
37
|
+
...E(t),
|
|
38
|
+
...n,
|
|
39
|
+
modal: !0
|
|
40
|
+
});
|
|
41
|
+
}, "AlertDialog"), O = v.forwardRef(/* @__PURE__ */ C(function(e, t) {
|
|
42
|
+
let { __scopeAlertDialog: n, ...r } = e;
|
|
43
|
+
return /* @__PURE__ */ y(g, {
|
|
44
|
+
...E(n),
|
|
45
|
+
...r,
|
|
46
|
+
ref: t
|
|
47
|
+
});
|
|
48
|
+
}, "AlertDialogTrigger")), k = /* @__PURE__ */ C((e) => {
|
|
49
|
+
let { __scopeAlertDialog: t, ...n } = e;
|
|
50
|
+
return /* @__PURE__ */ y(s, {
|
|
51
|
+
...E(t),
|
|
52
|
+
...n
|
|
53
|
+
});
|
|
54
|
+
}, "AlertDialogPortal"), A = v.forwardRef(/* @__PURE__ */ C(function(e, t) {
|
|
55
|
+
let { __scopeAlertDialog: n, ...r } = e;
|
|
56
|
+
return /* @__PURE__ */ y(m, {
|
|
57
|
+
...E(n),
|
|
58
|
+
...r,
|
|
59
|
+
ref: t
|
|
60
|
+
});
|
|
61
|
+
}, "AlertDialogOverlay")), [j, M] = w("AlertDialogContent"), N = v.forwardRef(/* @__PURE__ */ C(function(e, t) {
|
|
62
|
+
let { __scopeAlertDialog: r, children: a, ...s } = e, c = E(r), l = n(t, v.useRef(null)), u = v.useRef(null);
|
|
63
|
+
return /* @__PURE__ */ y(j, {
|
|
64
|
+
scope: r,
|
|
65
|
+
cancelRef: u,
|
|
66
|
+
children: /* @__PURE__ */ y(o, {
|
|
67
|
+
role: "alertdialog",
|
|
68
|
+
...c,
|
|
69
|
+
...s,
|
|
70
|
+
ref: l,
|
|
71
|
+
onOpenAutoFocus: i(s.onOpenAutoFocus, (e) => {
|
|
72
|
+
e.preventDefault(), u.current?.focus({ preventScroll: !0 });
|
|
73
|
+
}),
|
|
74
|
+
onPointerDownOutside: (e) => e.preventDefault(),
|
|
75
|
+
onInteractOutside: (e) => e.preventDefault(),
|
|
76
|
+
children: a
|
|
77
|
+
})
|
|
78
|
+
});
|
|
79
|
+
}, "AlertDialogContent")), P = v.forwardRef(/* @__PURE__ */ C(function(e, t) {
|
|
80
|
+
let { __scopeAlertDialog: n, ...r } = e;
|
|
81
|
+
return /* @__PURE__ */ y(u, {
|
|
82
|
+
...E(n),
|
|
83
|
+
...r,
|
|
84
|
+
ref: t
|
|
85
|
+
});
|
|
86
|
+
}, "AlertDialogTitle")), F = v.forwardRef(/* @__PURE__ */ C(function(e, t) {
|
|
87
|
+
let { __scopeAlertDialog: n, ...r } = e;
|
|
88
|
+
return /* @__PURE__ */ y(f, {
|
|
89
|
+
...E(n),
|
|
90
|
+
...r,
|
|
91
|
+
ref: t
|
|
92
|
+
});
|
|
93
|
+
}, "AlertDialogDescription")), I = v.forwardRef(/* @__PURE__ */ C(function(e, t) {
|
|
94
|
+
let { __scopeAlertDialog: n, ...r } = e;
|
|
95
|
+
return /* @__PURE__ */ y(l, {
|
|
96
|
+
...E(n),
|
|
97
|
+
...r,
|
|
98
|
+
ref: t
|
|
99
|
+
});
|
|
100
|
+
}, "AlertDialogAction")), L = "AlertDialogCancel", R = v.forwardRef(/* @__PURE__ */ C(function(e, t) {
|
|
101
|
+
let { __scopeAlertDialog: r, ...i } = e, { cancelRef: a } = M(L, r), o = E(r), s = n(t, a);
|
|
102
|
+
return /* @__PURE__ */ y(l, {
|
|
103
|
+
...o,
|
|
104
|
+
...i,
|
|
105
|
+
ref: s
|
|
106
|
+
});
|
|
107
|
+
}, "AlertDialogCancel")), z = D, B = O, V = k, H = A, U = N, W = I, G = R, K = P, q = F;
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region lib/components/ui/feedback/alert-dialog/alert-dialog.tsx
|
|
110
|
+
function J({ ...e }) {
|
|
111
|
+
return /* @__PURE__ */ y(z, {
|
|
112
|
+
"data-slot": "alert-dialog",
|
|
113
|
+
...e
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
function Y({ children: e, asChild: t = !0, ...n }) {
|
|
117
|
+
return /* @__PURE__ */ y(B, {
|
|
118
|
+
"data-slot": "alert-dialog-trigger",
|
|
119
|
+
asChild: t,
|
|
120
|
+
...n,
|
|
121
|
+
children: /* @__PURE__ */ y("div", { children: e })
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
function X({ ...e }) {
|
|
125
|
+
return /* @__PURE__ */ y(V, {
|
|
126
|
+
"data-slot": "alert-dialog-portal",
|
|
127
|
+
...e
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
function Z({ className: e, ...n }) {
|
|
131
|
+
return /* @__PURE__ */ y(H, {
|
|
132
|
+
"data-slot": "alert-dialog-overlay",
|
|
133
|
+
className: t("nxgt-scrim fixed inset-0 z-50", e),
|
|
134
|
+
...n
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
function Q({ className: e, onOpenAutoFocus: n, onCloseAutoFocus: r, onEscapeKeyDown: i, ref: o, ...s }) {
|
|
138
|
+
let c = h({
|
|
139
|
+
onOpenAutoFocus: n,
|
|
140
|
+
onCloseAutoFocus: r
|
|
141
|
+
}, { focusFallback: !0 }), l = d({
|
|
142
|
+
ref: o,
|
|
143
|
+
onEscapeKeyDown: i,
|
|
144
|
+
...s
|
|
145
|
+
}, !0);
|
|
146
|
+
return /* @__PURE__ */ y(_, { children: /* @__PURE__ */ y(a, {
|
|
147
|
+
value: !0,
|
|
148
|
+
children: /* @__PURE__ */ b(X, { children: [/* @__PURE__ */ y(Z, { ref: l.overlayRef }), /* @__PURE__ */ y(U, {
|
|
149
|
+
ref: l.ref,
|
|
150
|
+
"data-slot": "alert-dialog-content",
|
|
151
|
+
className: t("nxgt-dialog fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 p-6 sm:max-w-lg max-h-[calc(100dvh-2rem)] supports-[not(height:100dvh)]:max-h-[calc(100vh-2rem)] overflow-y-auto", e),
|
|
152
|
+
onOpenAutoFocus: c.onOpenAutoFocus,
|
|
153
|
+
onCloseAutoFocus: c.onCloseAutoFocus,
|
|
154
|
+
onEscapeKeyDown: l.onEscapeKeyDown,
|
|
155
|
+
...s,
|
|
156
|
+
onFocusOutside: l.outside.onFocusOutside
|
|
157
|
+
})] })
|
|
158
|
+
}) });
|
|
159
|
+
}
|
|
160
|
+
function $({ className: e, ...n }) {
|
|
161
|
+
return /* @__PURE__ */ y("div", {
|
|
162
|
+
"data-slot": "alert-dialog-header",
|
|
163
|
+
className: t("flex flex-col gap-2 text-center sm:text-left", e),
|
|
164
|
+
...n
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
function ee({ className: e, ...n }) {
|
|
168
|
+
return /* @__PURE__ */ y("div", {
|
|
169
|
+
"data-slot": "alert-dialog-footer",
|
|
170
|
+
className: t("flex flex-col-reverse gap-2 pt-2 max-sm:*:w-full sm:flex-row sm:justify-end", e),
|
|
171
|
+
...n
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
function te({ className: e, ...n }) {
|
|
175
|
+
return /* @__PURE__ */ y(K, {
|
|
176
|
+
"data-slot": "alert-dialog-title",
|
|
177
|
+
className: t("text-2xl/8 font-medium tracking-tight text-foreground", e),
|
|
178
|
+
...n
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
function ne({ className: e, ...n }) {
|
|
182
|
+
return /* @__PURE__ */ y(q, {
|
|
183
|
+
"data-slot": "alert-dialog-description",
|
|
184
|
+
className: t("text-muted-foreground text-sm/6", e),
|
|
185
|
+
...n
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
//#endregion
|
|
189
|
+
export { $ as a, te as c, G as d, x as f, ee as i, Y as l, Q as n, Z as o, ne as r, X as s, J as t, W as u };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r } from "./translator-B9XjUDRu.js";
|
|
1
|
+
import { l as e, r as t, s as n, u as r } from "./translator-Caf-d96e.js";
|
|
3
2
|
import { t as i } from "./_baseIsEqual-C6ksIHya.js";
|
|
4
3
|
import { useMemo as a } from "react";
|
|
5
4
|
import { asyncThunkCreator as o, buildCreateSlice as s } from "@reduxjs/toolkit";
|
|
@@ -84,8 +83,8 @@ var S = (e) => {
|
|
|
84
83
|
if (Object.getPrototypeOf(e) !== Object.prototype && e.constructor) return e.constructor.name;
|
|
85
84
|
}
|
|
86
85
|
return t;
|
|
87
|
-
}, C = ({ storageKey: i =
|
|
88
|
-
let s = () => typeof a == "function" ? a() : a ?? n(i, "en",
|
|
86
|
+
}, C = ({ storageKey: i = e, language: a, translate: o = t } = {}) => {
|
|
87
|
+
let s = () => typeof a == "function" ? a() : a ?? n(i, "en", r);
|
|
89
88
|
return (e) => {
|
|
90
89
|
let t = s(), n = (e, n) => o(e, n, t), r = (e, t) => {
|
|
91
90
|
let r = n(e, t);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
2
|
import { n as t, t as n } from "./dist-DVRQkaTK.js";
|
|
3
|
-
import { n as r, r as i, t as a } from "./spinner-
|
|
3
|
+
import { n as r, r as i, t as a } from "./spinner-CAnpF3RK.js";
|
|
4
4
|
import { a as o, i as s, n as c, o as l, s as u, t as d } from "./use-click-lock-BZYtTmVt.js";
|
|
5
5
|
import { t as f } from "./is-production-GLw59WU8.js";
|
|
6
6
|
import { t as p } from "./button-group-context-CaP0X5p_.js";
|
package/dist/charts.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as e } from "./ui.utils-CAnKTCw5.js";
|
|
2
2
|
import { t } from "./utils-BLfntITJ.js";
|
|
3
3
|
import { t as n } from "./warn-once-C_e47JM8.js";
|
|
4
|
-
import { t as r } from "./button-
|
|
5
|
-
import { t as i } from "./use-material-translation-
|
|
4
|
+
import { t as r } from "./button-DfS_amfQ.js";
|
|
5
|
+
import { t as i } from "./use-material-translation-C_1cWRzW.js";
|
|
6
6
|
import { t as a } from "./use-ssr-media-query-C6M5m8sf.js";
|
|
7
7
|
import { i as o, n as s, r as c, t as l } from "./util-4heV2LPI.js";
|
|
8
8
|
import { t as u } from "./useIsomorphicLayoutEffect-DfgAhWcH.js";
|
|
9
|
-
import { t as d } from "./chip-
|
|
9
|
+
import { t as d } from "./chip-Cbndukko.js";
|
|
10
10
|
import { c as f, d as p, f as m, i as h, o as g, p as _, s as v, t as y } from "./line-path-C5pZGC49.js";
|
|
11
11
|
import { t as b } from "./live-status-BGPaN8r8.js";
|
|
12
12
|
import { t as x } from "./linear-G97mfnKF.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
|
-
import { r as t } from "./spinner-
|
|
2
|
+
import { r as t } from "./spinner-CAnpF3RK.js";
|
|
3
3
|
import { s as n } from "./use-click-lock-BZYtTmVt.js";
|
|
4
|
-
import { t as r } from "./use-material-translation-
|
|
4
|
+
import { t as r } from "./use-material-translation-C_1cWRzW.js";
|
|
5
5
|
import { t as i } from "./react-node-text-Crkpfpco.js";
|
|
6
6
|
import { cloneElement as a, isValidElement as o } from "react";
|
|
7
7
|
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { r as e } from "./rolldown-runtime-BFFgcFxR.js";
|
|
2
2
|
import { t } from "./utils-BLfntITJ.js";
|
|
3
3
|
import { a as n } from "./dist-lmHmz_bu.js";
|
|
4
|
-
import { c as r, d as i, f as a, n as o, t as s } from "./dropdown-menu-
|
|
5
|
-
import { a as c, i as l, n as u } from "./field-blur-context-
|
|
6
|
-
import { a as d, d as f, r as p, t as m, u as h } from "./toolbar-items-
|
|
4
|
+
import { c as r, d as i, f as a, n as o, t as s } from "./dropdown-menu-_SyVmSuy.js";
|
|
5
|
+
import { a as c, i as l, n as u } from "./field-blur-context-DPe5_Nv5.js";
|
|
6
|
+
import { a as d, d as f, r as p, t as m, u as h } from "./toolbar-items-_ezD5B0r.js";
|
|
7
7
|
import { t as g } from "./is-production-GLw59WU8.js";
|
|
8
|
-
import { t as _ } from "./use-material-translation-
|
|
9
|
-
import { i as v, n as y, o as b, t as x } from "./code-language-items-
|
|
10
|
-
import {
|
|
11
|
-
import { t as w } from "./
|
|
8
|
+
import { t as _ } from "./use-material-translation-C_1cWRzW.js";
|
|
9
|
+
import { i as v, n as y, o as b, t as x } from "./code-language-items-andgHKrM.js";
|
|
10
|
+
import { t as S } from "./useIsomorphicLayoutEffect-DfgAhWcH.js";
|
|
11
|
+
import { n as C, t as w } from "./escape-owner-DpaP0lm1.js";
|
|
12
12
|
import { t as T } from "./skeleton-DSdtr2qc.js";
|
|
13
13
|
import { t as E } from "./react-node-text-Crkpfpco.js";
|
|
14
14
|
import D, { memo as O, useCallback as ee, useEffect as k, useId as A, useImperativeHandle as j, useMemo as M, useRef as N, useState as P } from "react";
|
|
@@ -975,7 +975,7 @@ function sn(e, t, r) {
|
|
|
975
975
|
t
|
|
976
976
|
]);
|
|
977
977
|
let o = (t) => {
|
|
978
|
-
let n = e.current, r = t.nativeEvent.defaultPrevented && !
|
|
978
|
+
let n = e.current, r = t.nativeEvent.defaultPrevented && !C(t.nativeEvent);
|
|
979
979
|
!i || !n || r || n.contains(t.target) && (t.key === "Escape" ? (t.preventDefault(), a(!1)) : t.key === "Tab" && on(t, n));
|
|
980
980
|
};
|
|
981
981
|
return {
|
|
@@ -989,7 +989,7 @@ function sn(e, t, r) {
|
|
|
989
989
|
tabIndex: -1
|
|
990
990
|
},
|
|
991
991
|
"data-fullscreen": i || void 0,
|
|
992
|
-
[
|
|
992
|
+
[w]: i || void 0,
|
|
993
993
|
onKeyDown: o
|
|
994
994
|
})
|
|
995
995
|
};
|
|
@@ -1327,10 +1327,10 @@ function Pn() {
|
|
|
1327
1327
|
}
|
|
1328
1328
|
function Fn(e, t) {
|
|
1329
1329
|
let n = M(() => jn(e, t), [e, t]), r = N(null), [i] = P(() => typeof document > "u" ? void 0 : Pn()), a = N(void 0);
|
|
1330
|
-
return
|
|
1330
|
+
return S(() => {
|
|
1331
1331
|
let e = r.current;
|
|
1332
1332
|
e && Mn(e, n, a.current), i && Nn(i, n, a.current), a.current = n;
|
|
1333
|
-
}, [n, i]),
|
|
1333
|
+
}, [n, i]), S(() => {
|
|
1334
1334
|
if (i) return (r.current?.parentElement?.closest("[role=\"dialog\"]") ?? document.body).appendChild(i), () => i.remove();
|
|
1335
1335
|
}, [i]), {
|
|
1336
1336
|
scope: n,
|
package/dist/code-editor.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
2
|
import { a as t } from "./dist-lmHmz_bu.js";
|
|
3
|
-
import { d as n, r, t as i, u as a } from "./toolbar-items-
|
|
4
|
-
import { t as o } from "./use-material-translation-
|
|
5
|
-
import { i as s, n as c, o as l } from "./code-language-items-
|
|
6
|
-
import { r as u, t as d } from "./field-blur-
|
|
3
|
+
import { d as n, r, t as i, u as a } from "./toolbar-items-_ezD5B0r.js";
|
|
4
|
+
import { t as o } from "./use-material-translation-C_1cWRzW.js";
|
|
5
|
+
import { i as s, n as c, o as l } from "./code-language-items-andgHKrM.js";
|
|
6
|
+
import { r as u, t as d } from "./field-blur-DyOByjzw.js";
|
|
7
7
|
import { t as f } from "./skeleton-DSdtr2qc.js";
|
|
8
8
|
import { t as p } from "./live-status-BGPaN8r8.js";
|
|
9
9
|
import { t as m } from "./use-mobile-BDro060N.js";
|
|
10
10
|
import { t as h } from "./react-node-text-Crkpfpco.js";
|
|
11
|
-
import { a as g, c as _, d as v, f as y, i as b, l as x, m as S, o as C, p as w, r as T, s as E, t as D, u as O } from "./code-editor-
|
|
11
|
+
import { a as g, c as _, d as v, f as y, i as b, l as x, m as S, o as C, p as w, r as T, s as E, t as D, u as O } from "./code-editor-B0tN8Ha_.js";
|
|
12
12
|
import { useEffect as k, useRef as A, useState as j } from "react";
|
|
13
13
|
import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
|
|
14
|
-
import {
|
|
14
|
+
import { getCspNonce as F } from "@nxgt/material-core/csp-nonce";
|
|
15
|
+
import { ChevronDown as I, ChevronUp as L, Columns2 as R } from "lucide-react";
|
|
15
16
|
//#region lib/components/ui/widgets/code-editor/code-editor-form-field.tsx
|
|
16
|
-
function
|
|
17
|
+
function z({ control: e, name: t, ...n }) {
|
|
17
18
|
return /* @__PURE__ */ N(u, {
|
|
18
19
|
control: e,
|
|
19
20
|
name: t,
|
|
@@ -34,12 +35,28 @@ function R({ control: e, name: t, ...n }) {
|
|
|
34
35
|
}
|
|
35
36
|
//#endregion
|
|
36
37
|
//#region lib/components/ui/widgets/code-editor/configure-monaco.ts
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
var B = Symbol.for("nxgt.material.monaco-nonce");
|
|
39
|
+
function V() {
|
|
40
|
+
if (typeof document > "u") return;
|
|
41
|
+
let e = document;
|
|
42
|
+
if (e[B]) return;
|
|
43
|
+
e[B] = !0;
|
|
44
|
+
let t = e.createElement.bind(e);
|
|
45
|
+
e.createElement = ((e, n) => {
|
|
46
|
+
let r = t(e, n);
|
|
47
|
+
if (e.toLowerCase() === "style") {
|
|
48
|
+
let e = F();
|
|
49
|
+
e && r.setAttribute("nonce", e);
|
|
50
|
+
}
|
|
51
|
+
return r;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function H(e) {
|
|
55
|
+
V(), S.config(e);
|
|
39
56
|
}
|
|
40
57
|
//#endregion
|
|
41
58
|
//#region lib/components/ui/widgets/code-editor/diff/code-diff-parts.tsx
|
|
42
|
-
function
|
|
59
|
+
function U({ added: e, removed: t }) {
|
|
43
60
|
let { t: n } = o();
|
|
44
61
|
return /* @__PURE__ */ P("span", {
|
|
45
62
|
className: "nxgt-code-diff-totals",
|
|
@@ -62,7 +79,7 @@ function B({ added: e, removed: t }) {
|
|
|
62
79
|
]
|
|
63
80
|
});
|
|
64
81
|
}
|
|
65
|
-
function
|
|
82
|
+
function W({ index: e, count: t, language: n, children: r }) {
|
|
66
83
|
let { t: i } = o(), a = t === 0 ? i("material.code.no-changes", "No changes") : e < 0 ? i("material.code.change-count", "{count, plural, one {# change} other {# changes}}", { count: t }) : i("material.code.change-of", "Change {index} of {count}", {
|
|
67
84
|
index: e + 1,
|
|
68
85
|
count: t
|
|
@@ -87,7 +104,7 @@ function V({ index: e, count: t, language: n, children: r }) {
|
|
|
87
104
|
}
|
|
88
105
|
//#endregion
|
|
89
106
|
//#region lib/components/ui/widgets/code-editor/diff/code-diff-toolbar.tsx
|
|
90
|
-
function
|
|
107
|
+
function G({ sideBySide: e, onSideBySideChange: t, changeCount: s, onStep: u, getCode: d }) {
|
|
91
108
|
let { t: f } = o(), { status: p, copy: m } = l();
|
|
92
109
|
return /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ P(n, {
|
|
93
110
|
label: f("material.code.diff-tools", "Diff tools"),
|
|
@@ -100,7 +117,7 @@ function H({ sideBySide: e, onSideBySideChange: t, changeCount: s, onStep: u, ge
|
|
|
100
117
|
className: "nxgt-code-toolbar",
|
|
101
118
|
children: [
|
|
102
119
|
t && /* @__PURE__ */ N(r, {
|
|
103
|
-
icon: /* @__PURE__ */ N(
|
|
120
|
+
icon: /* @__PURE__ */ N(R, {}),
|
|
104
121
|
label: f("material.code.side-by-side", "Side by side"),
|
|
105
122
|
priority: 1,
|
|
106
123
|
pressed: !!e,
|
|
@@ -110,12 +127,12 @@ function H({ sideBySide: e, onSideBySideChange: t, changeCount: s, onStep: u, ge
|
|
|
110
127
|
label: f("material.code.changes", "Changes"),
|
|
111
128
|
priority: 3,
|
|
112
129
|
children: [/* @__PURE__ */ N(i, {
|
|
113
|
-
icon: /* @__PURE__ */ N(
|
|
130
|
+
icon: /* @__PURE__ */ N(L, {}),
|
|
114
131
|
label: f("material.code.previous-change", "Previous change"),
|
|
115
132
|
disabled: !s,
|
|
116
133
|
onClick: () => u(-1)
|
|
117
134
|
}), /* @__PURE__ */ N(i, {
|
|
118
|
-
icon: /* @__PURE__ */ N(
|
|
135
|
+
icon: /* @__PURE__ */ N(I, {}),
|
|
119
136
|
label: f("material.code.next-change", "Next change"),
|
|
120
137
|
disabled: !s,
|
|
121
138
|
onClick: () => u(1)
|
|
@@ -133,24 +150,24 @@ function H({ sideBySide: e, onSideBySideChange: t, changeCount: s, onStep: u, ge
|
|
|
133
150
|
}
|
|
134
151
|
//#endregion
|
|
135
152
|
//#region lib/components/ui/widgets/code-editor/diff/diff-changes.ts
|
|
136
|
-
var
|
|
137
|
-
function
|
|
153
|
+
var K = (e, t) => t > 0 ? t - e + 1 : 0;
|
|
154
|
+
function q(e) {
|
|
138
155
|
let t = 0, n = 0;
|
|
139
|
-
for (let r of e) t +=
|
|
156
|
+
for (let r of e) t += K(r.modifiedStartLineNumber, r.modifiedEndLineNumber), n += K(r.originalStartLineNumber, r.originalEndLineNumber);
|
|
140
157
|
return {
|
|
141
158
|
added: t,
|
|
142
159
|
removed: n
|
|
143
160
|
};
|
|
144
161
|
}
|
|
145
|
-
function
|
|
162
|
+
function J(e) {
|
|
146
163
|
return Math.max(1, e.modifiedEndLineNumber > 0 ? e.modifiedStartLineNumber : e.modifiedStartLineNumber + 1);
|
|
147
164
|
}
|
|
148
|
-
function
|
|
165
|
+
function Y(e, t, n) {
|
|
149
166
|
return n === 0 ? -1 : e < 0 ? t === 1 ? 0 : n - 1 : (e + t + n) % n;
|
|
150
167
|
}
|
|
151
168
|
//#endregion
|
|
152
169
|
//#region lib/components/ui/widgets/code-editor/diff/use-diff-changes.ts
|
|
153
|
-
function
|
|
170
|
+
function X(e) {
|
|
154
171
|
let [t, n] = j([]), [r, i] = j(-1);
|
|
155
172
|
return k(() => {
|
|
156
173
|
if (!e) return;
|
|
@@ -164,9 +181,9 @@ function q(e) {
|
|
|
164
181
|
changes: t,
|
|
165
182
|
index: r,
|
|
166
183
|
go: (n) => {
|
|
167
|
-
let a =
|
|
184
|
+
let a = Y(r, n, t.length);
|
|
168
185
|
if (!e || a < 0) return;
|
|
169
|
-
let o =
|
|
186
|
+
let o = J(t[a]), s = e.getModifiedEditor();
|
|
170
187
|
s.setPosition({
|
|
171
188
|
lineNumber: o,
|
|
172
189
|
column: 1
|
|
@@ -176,7 +193,7 @@ function q(e) {
|
|
|
176
193
|
}
|
|
177
194
|
//#endregion
|
|
178
195
|
//#region lib/components/ui/widgets/code-editor/diff/use-narrower.ts
|
|
179
|
-
function
|
|
196
|
+
function Z(e, t) {
|
|
180
197
|
let [n, r] = j(!1);
|
|
181
198
|
return k(() => {
|
|
182
199
|
let n = e.current;
|
|
@@ -187,13 +204,13 @@ function J(e, t) {
|
|
|
187
204
|
}
|
|
188
205
|
//#endregion
|
|
189
206
|
//#region lib/components/ui/widgets/code-editor/diff/code-diff.tsx
|
|
190
|
-
var
|
|
191
|
-
function
|
|
192
|
-
let { original: r, modified: i, language: a = "typescript", height: o = 280 } = n, s = n.showChrome ?? !0, c = v(), l = b(n.theme, n.scheme), u = m(), d =
|
|
207
|
+
var Q = 480;
|
|
208
|
+
function $(n) {
|
|
209
|
+
let { original: r, modified: i, language: a = "typescript", height: o = 280 } = n, s = n.showChrome ?? !0, c = v(), l = b(n.theme, n.scheme), u = m(), d = Z(l.surfaceRef, Q), p = u || d, [g, S] = t({
|
|
193
210
|
prop: n.sideBySide,
|
|
194
211
|
defaultProp: n.defaultSideBySide ?? !0,
|
|
195
212
|
onChange: n.onSideBySideChange
|
|
196
|
-
}), [C, T] = j(), { changes: E, index: D, go: k } =
|
|
213
|
+
}), [C, T] = j(), { changes: E, index: D, go: k } = X(C), A = ne(), M = ee(h(n.label) || h(n.filename)), F = (e, t) => {
|
|
197
214
|
A.keep(e), x(t), T(e);
|
|
198
215
|
};
|
|
199
216
|
return /* @__PURE__ */ P("div", {
|
|
@@ -209,8 +226,8 @@ function X(n) {
|
|
|
209
226
|
className: "nxgt-code-filename",
|
|
210
227
|
children: n.filename
|
|
211
228
|
}),
|
|
212
|
-
C && /* @__PURE__ */ N(
|
|
213
|
-
/* @__PURE__ */ N(
|
|
229
|
+
C && /* @__PURE__ */ N(U, { ...q(E) }),
|
|
230
|
+
/* @__PURE__ */ N(G, {
|
|
214
231
|
sideBySide: g,
|
|
215
232
|
onSideBySideChange: p ? void 0 : S,
|
|
216
233
|
changeCount: E.length,
|
|
@@ -230,7 +247,7 @@ function X(n) {
|
|
|
230
247
|
keepCurrentModifiedModel: !0,
|
|
231
248
|
onMount: F,
|
|
232
249
|
options: {
|
|
233
|
-
...
|
|
250
|
+
...te(l.overflow, g && !p),
|
|
234
251
|
...M
|
|
235
252
|
},
|
|
236
253
|
loading: /* @__PURE__ */ N(f, {
|
|
@@ -238,7 +255,7 @@ function X(n) {
|
|
|
238
255
|
className: "w-full"
|
|
239
256
|
})
|
|
240
257
|
}),
|
|
241
|
-
s && /* @__PURE__ */ N(
|
|
258
|
+
s && /* @__PURE__ */ N(W, {
|
|
242
259
|
index: D,
|
|
243
260
|
count: E.length,
|
|
244
261
|
language: a
|
|
@@ -246,25 +263,25 @@ function X(n) {
|
|
|
246
263
|
]
|
|
247
264
|
});
|
|
248
265
|
}
|
|
249
|
-
function
|
|
266
|
+
function ee(e) {
|
|
250
267
|
let { t } = o();
|
|
251
268
|
return {
|
|
252
269
|
originalAriaLabel: e ? t("material.code.original-of", "{name}, original", { name: e }) : t("material.code.original", "Original"),
|
|
253
270
|
ariaLabel: e ? t("material.code.modified-of", "{name}, modified", { name: e }) : t("material.code.modified", "Modified")
|
|
254
271
|
};
|
|
255
272
|
}
|
|
256
|
-
function
|
|
273
|
+
function te(e, t) {
|
|
257
274
|
return {
|
|
258
275
|
...E,
|
|
259
276
|
overflowWidgetsDomNode: e,
|
|
260
277
|
readOnly: !0,
|
|
261
278
|
renderSideBySide: t,
|
|
262
|
-
renderSideBySideInlineBreakpoint:
|
|
279
|
+
renderSideBySideInlineBreakpoint: Q,
|
|
263
280
|
renderGutterMenu: !1,
|
|
264
281
|
renderOverviewRuler: !1
|
|
265
282
|
};
|
|
266
283
|
}
|
|
267
|
-
function
|
|
284
|
+
function ne() {
|
|
268
285
|
let e = A([]);
|
|
269
286
|
return k(() => () => {
|
|
270
287
|
let t = e.current;
|
|
@@ -277,4 +294,4 @@ function $() {
|
|
|
277
294
|
} };
|
|
278
295
|
}
|
|
279
296
|
//#endregion
|
|
280
|
-
export { g as CODE_THEMES,
|
|
297
|
+
export { g as CODE_THEMES, $ as CodeDiff, D as CodeEditor, z as CodeEditorFormField, H as configureMonaco, C as defineCodeTheme };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as e, f as t } from "./dropdown-menu-
|
|
2
|
-
import { t as n } from "./use-material-translation-
|
|
1
|
+
import { d as e, f as t } from "./dropdown-menu-_SyVmSuy.js";
|
|
2
|
+
import { t as n } from "./use-material-translation-C_1cWRzW.js";
|
|
3
3
|
import { t as r } from "./live-status-BGPaN8r8.js";
|
|
4
4
|
import { useEffect as i, useRef as a, useState as o } from "react";
|
|
5
5
|
import { jsx as s } from "react/jsx-runtime";
|