@plitzi/sdk-elements 0.38.6 → 0.38.7
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 +205 -0
- package/dist/Element/hooks/useRscData.d.ts +1 -1
- package/dist/components/MarkdownDocument/MarkdownDocument.d.ts +32 -0
- package/dist/components/MarkdownDocument/MarkdownDocument.mjs +32 -0
- package/dist/components/MarkdownDocument/components/CodeBlock/CodeBlock.d.ts +14 -0
- package/dist/components/MarkdownDocument/components/CodeBlock/CodeBlock.mjs +34 -0
- package/dist/components/MarkdownDocument/components/CodeBlock/index.d.ts +3 -0
- package/dist/components/MarkdownDocument/components/CodeBlock/index.mjs +5 -0
- package/dist/components/MarkdownDocument/helpers/hastText.d.ts +10 -0
- package/dist/components/MarkdownDocument/helpers/hastText.mjs +4 -0
- package/dist/components/MarkdownDocument/helpers/markdownComponents.d.ts +10 -0
- package/dist/components/MarkdownDocument/helpers/markdownComponents.mjs +89 -0
- package/dist/components/MarkdownDocument/helpers/markdownParts.d.ts +16 -0
- package/dist/components/MarkdownDocument/helpers/markdownParts.mjs +4 -0
- package/dist/components/MarkdownDocument/helpers/rehypeHeadingAnchors.d.ts +8 -0
- package/dist/components/MarkdownDocument/helpers/rehypeHeadingAnchors.mjs +20 -0
- package/dist/components/MarkdownDocument/helpers/syntaxHighlighter.d.ts +3 -0
- package/dist/components/MarkdownDocument/helpers/syntaxHighlighter.mjs +24 -0
- package/dist/components/MarkdownDocument/index.d.ts +5 -0
- package/dist/components/MarkdownDocument/index.mjs +6 -0
- package/dist/dataSource/GlobalSources.mjs +101 -113
- package/dist/elements/advanced/Custom/declaration.d.ts +5 -1
- package/dist/elements/advanced/Custom/declaration.mjs +5 -1
- package/dist/elements/advanced/Custom/index.d.ts +5 -1
- package/dist/elements/basic/Button/declaration.d.ts +46 -34
- package/dist/elements/basic/Button/declaration.mjs +18 -42
- package/dist/elements/basic/Button/index.d.ts +46 -34
- package/dist/elements/basic/Dropdown/DropdownPopup/declaration.d.ts +2 -0
- package/dist/elements/basic/Dropdown/DropdownPopup/declaration.mjs +2 -0
- package/dist/elements/basic/Dropdown/DropdownPopup/index.d.ts +2 -0
- package/dist/elements/basic/Dropdown/index.d.ts +2 -0
- package/dist/elements/basic/Heading/declaration.d.ts +5 -1
- package/dist/elements/basic/Heading/declaration.mjs +5 -1
- package/dist/elements/basic/Heading/index.d.ts +5 -1
- package/dist/elements/basic/Link/Link.d.ts +7 -1
- package/dist/elements/basic/Link/Link.mjs +27 -27
- package/dist/elements/basic/Link/Settings.d.ts +2 -1
- package/dist/elements/basic/Link/Settings.mjs +42 -29
- package/dist/elements/basic/Link/ariaCurrent.d.ts +12 -0
- package/dist/elements/basic/Link/ariaCurrent.mjs +11 -0
- package/dist/elements/basic/Link/declaration.d.ts +5 -1
- package/dist/elements/basic/Link/declaration.mjs +7 -4
- package/dist/elements/basic/Link/index.d.ts +5 -1
- package/dist/elements/basic/Markdown/Markdown.d.ts +6 -1
- package/dist/elements/basic/Markdown/Markdown.mjs +19 -15
- package/dist/elements/basic/Markdown/Settings.d.ts +2 -1
- package/dist/elements/basic/Markdown/Settings.mjs +16 -10
- package/dist/elements/basic/Markdown/declaration.d.ts +32 -5
- package/dist/elements/basic/Markdown/declaration.mjs +37 -7
- package/dist/elements/basic/Markdown/hooks/useMarkdownClassNames.d.ts +7 -0
- package/dist/elements/basic/Markdown/hooks/useMarkdownClassNames.mjs +13 -0
- package/dist/elements/basic/Markdown/index.d.ts +32 -5
- package/dist/elements/basic/RichText/RichText.mjs +27 -20
- package/dist/elements/basic/RichText/classHtmlParts.d.ts +14 -0
- package/dist/elements/basic/RichText/classHtmlParts.mjs +48 -0
- package/dist/elements/basic/RichText/declaration.d.ts +28 -1
- package/dist/elements/basic/RichText/declaration.mjs +31 -2
- package/dist/elements/basic/RichText/index.d.ts +28 -1
- package/dist/elements/basic/Text/declaration.d.ts +0 -2
- package/dist/elements/basic/Text/declaration.mjs +1 -5
- package/dist/elements/basic/Text/index.d.ts +0 -2
- package/dist/elements/basic/ThemeToggle/ThemeToggle.mjs +20 -18
- package/dist/elements/basic/ThemeToggle/declaration.d.ts +48 -4
- package/dist/elements/basic/ThemeToggle/declaration.mjs +32 -8
- package/dist/elements/basic/ThemeToggle/index.d.ts +48 -4
- package/dist/elements/declarations/index.d.ts +781 -318
- package/dist/elements/form/FormControl/FormControl.mjs +51 -53
- package/dist/elements/form/FormControl/Settings.mjs +4 -0
- package/dist/elements/form/FormControl/components/Label.d.ts +3 -1
- package/dist/elements/form/FormControl/components/Label.mjs +5 -5
- package/dist/elements/form/FormControl/declaration.d.ts +479 -233
- package/dist/elements/form/FormControl/declaration.mjs +142 -76
- package/dist/elements/form/FormControl/helpers/isChecked.d.ts +8 -0
- package/dist/elements/form/FormControl/helpers/isChecked.mjs +4 -0
- package/dist/elements/form/FormControl/hocs/withFieldValue.mjs +2 -6
- package/dist/elements/form/FormControl/index.d.ts +479 -233
- package/dist/elements/form/FormControl/inputs/Checkbox.d.ts +7 -3
- package/dist/elements/form/FormControl/inputs/Checkbox.mjs +7 -6
- package/dist/elements/form/FormControl/inputs/Input.d.ts +6 -1
- package/dist/elements/form/FormControl/inputs/Input.mjs +29 -29
- package/dist/elements/form/FormControl/inputs/Select.d.ts +4 -1
- package/dist/elements/form/FormControl/inputs/Select.mjs +15 -15
- package/dist/elements/internal/NotFound/declaration.d.ts +5 -1
- package/dist/elements/internal/NotFound/declaration.mjs +5 -1
- package/dist/elements/internal/NotFound/index.d.ts +5 -1
- package/dist/elements/internal/Page/declaration.d.ts +1 -2
- package/dist/elements/internal/Page/declaration.mjs +2 -3
- package/dist/elements/internal/Page/index.d.ts +1 -2
- package/dist/elements/media/Image/declaration.d.ts +3 -2
- package/dist/elements/media/Image/declaration.mjs +3 -2
- package/dist/elements/media/Image/index.d.ts +3 -2
- package/dist/elements/provider/ApiContainer/ApiContainer.mjs +89 -80
- package/dist/elements/provider/ApiContainer/hooks/useApi.mjs +23 -23
- package/dist/elements/provider/ApiContainer/hooks/useProviderWrite.mjs +5 -5
- package/dist/elements/structure/Carousel/CarouselTrack/declaration.d.ts +4 -1
- package/dist/elements/structure/Carousel/CarouselTrack/declaration.mjs +4 -1
- package/dist/elements/structure/Carousel/CarouselTrack/index.d.ts +4 -1
- package/dist/elements/structure/Carousel/index.d.ts +4 -1
- package/dist/elements/structure/DialogContainer/DialogContainer.mjs +2 -2
- package/dist/elements/structure/DialogContainer/declaration.d.ts +72 -12
- package/dist/elements/structure/DialogContainer/declaration.mjs +58 -17
- package/dist/elements/structure/DialogContainer/index.d.ts +72 -12
- package/dist/elements/structure/List/declaration.d.ts +5 -1
- package/dist/elements/structure/List/declaration.mjs +5 -1
- package/dist/elements/structure/List/index.d.ts +5 -1
- package/dist/elements/structure/ModalContainer/declaration.d.ts +36 -16
- package/dist/elements/structure/ModalContainer/declaration.mjs +42 -24
- package/dist/elements/structure/ModalContainer/index.d.ts +36 -16
- package/dist/elements/structure/Pagination/Pagination.mjs +23 -23
- package/dist/elements/structure/Pagination/declaration.d.ts +5 -1
- package/dist/elements/structure/Pagination/declaration.mjs +8 -2
- package/dist/elements/structure/Pagination/index.d.ts +5 -1
- package/dist/elements/structure/TabContainer/TabContainerItem/TabContainerItem.mjs +2 -1
- package/dist/index.d.ts +781 -318
- package/package.json +77 -13
- package/dist/elements/basic/Link/isCurrentPage.d.ts +0 -5
- package/dist/elements/basic/Link/isCurrentPage.mjs +0 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,210 @@
|
|
|
1
1
|
# @plitzi/sdk-elements
|
|
2
2
|
|
|
3
|
+
## 0.38.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c7bbc2b: ## A server project's `src/main.ts` is a few lines
|
|
8
|
+
|
|
9
|
+
- **`serveProject` from `@plitzi/sdk-server/project`**: the generated `src/main.ts` hands the space, its actions and
|
|
10
|
+
its options to the server, and the rest comes with the package — the port, the plugins of `src/plugins` and
|
|
11
|
+
`vendor/plugins`, the functions and runtime, `public/`, `src/data/`, the `kv` in `state/kv.json`, `/health`,
|
|
12
|
+
`tmp/dev-server.json` and the reloads while developing. A fix there arrives with `npm update`, not `plitzi upgrade`.
|
|
13
|
+
- **No more `tmp/space.json` while developing**: a saved space is authored again in its own process and handed to the
|
|
14
|
+
server over IPC (`plitzi/author.ts --ipc`, in place of `--out`); the server swaps it in memory and the open pages
|
|
15
|
+
reload, and a refused space keeps the last one that authored. `plitzi doctor` reports a leftover `tmp/space.json`.
|
|
16
|
+
- **`projectAuthoring()` in `@plitzi/sdk-authoring/node`**: what a project's space is checked against — its plugins'
|
|
17
|
+
declarations, its built plugins, its data files — once, for the server and `npm run author` alike. Neither it nor
|
|
18
|
+
`serveProject` takes a root: it is the working directory, where every script runs (`projectAuthoringAt(root)` for a
|
|
19
|
+
tool working on another folder).
|
|
20
|
+
- **`authorProjectSpace` and `projectSpace()` in `@plitzi/sdk-authoring/node`**: the project's space read from
|
|
21
|
+
`src/space/index.ts` — `dist/space/index.js` when the server runs built — once its root and layout are checked, and
|
|
22
|
+
authored. `src/main.ts` is `serveProject({ space: authorProjectSpace, actions, connectors, serverOptions })`, with no
|
|
23
|
+
import of the space; `plitzi/author.ts`, the visual tests and the CLI's checks read it the same way. A module that
|
|
24
|
+
exports no `space` is refused saying what to export (`ProjectSpaceError`).
|
|
25
|
+
- **`.env` lives at the root and Node reads it** as each script starts (`--env-file-if-exists=.env`; `start:dev`
|
|
26
|
+
preloads `@plitzi/sdk-server/env`, since a watched process would restart on every change beside the file). Settings
|
|
27
|
+
read at the top level of `src/config/serverOptions.ts` or the actions are set. Every project gets `.env` and
|
|
28
|
+
`.env.example`; `plitzi upgrade` removes the old `src/env.ts`.
|
|
29
|
+
- **One check of a project's layout** (`@plitzi/sdk-shared/project/layout`): a plugin folder with no entry, a
|
|
30
|
+
JavaScript entry, `src/plugin/` for `src/plugins/`, a `.env` inside `src/`, a space exported by default, a broken
|
|
31
|
+
`vendor/` plugin… The server refuses to boot listing every error with its fix, `npm run author` and the CLI's checks
|
|
32
|
+
refuse with the same words, `plitzi doctor` lists them under `layout` and `--fix` makes the ones with a single fix,
|
|
33
|
+
and `plitzi lint` points at doctor. A plugin folder added broken while developing is reported in the terminal
|
|
34
|
+
instead of failing in esbuild. Plugins may start at `index.tsx`.
|
|
35
|
+
- **`createJsonAdapters` serves documents held in memory**: `offlineData` may be a function returning them, not only a
|
|
36
|
+
path.
|
|
37
|
+
- **One source for a project's layout**, `@plitzi/sdk-shared/project/paths`; `src/config/serverOptions.ts` is typed
|
|
38
|
+
`ProjectServerOptions`. `plitzi upgrade files --write` brings an existing project's `main.ts` and `author.ts` up.
|
|
39
|
+
- **`npm run build` no longer fails on a plugin's stylesheet**: `tsconfig.build.json` includes `plitzi/assets.d.ts`,
|
|
40
|
+
which a space importing a plugin's declaration reaches through its component.
|
|
41
|
+
|
|
42
|
+
## A write refreshes what shows it
|
|
43
|
+
- **Writes now refresh server-driven providers.** `runServerAction`, `webHook`, `writeRecord` and the
|
|
44
|
+
`invalidateQueries` step reach `runtime: 'server'` api containers by id, by `query` URL, or all of them, just as
|
|
45
|
+
they reach cached browser requests. Before, they reached only the browser's query cache, so a saved write left the
|
|
46
|
+
page showing the old value until a reload. Hidden providers refresh when they are shown.
|
|
47
|
+
- **A refresh because something changed asks around every cache.** `performQuery`, writes and invalidations send
|
|
48
|
+
`Cache-Control: no-cache`; `/_rsc` resolves such a request again instead of serving its cached slice, and keeps the
|
|
49
|
+
new answer. A `refreshSeconds` timer and a "load more" page still go through the caches.
|
|
50
|
+
- **`refreshRsc`'s fourth argument is an options object**, `{ location?, fresh? }`.
|
|
51
|
+
|
|
52
|
+
## A space's functions read its data
|
|
53
|
+
- **`ctx.data('products.json')`** reads one file of the space's data (a project's `src/data/`), parsed and read-only,
|
|
54
|
+
as of the run's version. Plugins' functions are refused it.
|
|
55
|
+
- **Self-hosted servers read `dataDir` through the same lookup as the platform**, so `/data/<file>` providers and
|
|
56
|
+
`ctx.data` read the same files; `plitzi functions dev` reads `src/data`. `/data/../x.json` is now the provider's
|
|
57
|
+
error state instead of falling through to `publicDir`.
|
|
58
|
+
- **Importing a file outside `functions/` names the boundary and the fix**: read the space's data with
|
|
59
|
+
`ctx.data('<file>')`.
|
|
60
|
+
|
|
61
|
+
## Signing in on a self-hosted server
|
|
62
|
+
- **`createServer({ auth })` tells the pages it renders where to sign in** (`server.auth`: provider, endpoints and
|
|
63
|
+
the session hint cookie), so a space signs in with no auth settings declared. Settings a space does declare still
|
|
64
|
+
win, and a space that names another provider ignores the server's description. New `pageAuth` server option, for a
|
|
65
|
+
deployment whose `/auth` flows are served by another host.
|
|
66
|
+
- **A page with no auth provider no longer offers `auth.login` / `auth.logout`**, and a sign-in that cannot work says
|
|
67
|
+
why in the console (`[plitzi] auth.login: …`) instead of failing silently. What a visitor keeps there
|
|
68
|
+
(`keepState`, `paintedState`) is the browser's, as on any space without accounts: what was kept as a guest's on such
|
|
69
|
+
a page before is let go once, on the first visit after the upgrade.
|
|
70
|
+
- **Renewal verifies the refresh token itself.** `findByRefreshToken` no longer has to report `refreshExpiresAt`; when
|
|
71
|
+
it does, it overrides the token's own expiry.
|
|
72
|
+
- **New authoring reference `auth.md`**: providers, `authLogin` and its result, `authLogout`, `{{ auth.* }}`,
|
|
73
|
+
`accessLevel`, visitor roles, action `access` and `ctx.user`.
|
|
74
|
+
|
|
75
|
+
## Flows
|
|
76
|
+
- **Authoring refuses a `when` that asks a step for a key it never publishes** (`condition-field-unpublished`).
|
|
77
|
+
`whenSucceeded` / `whenFailed` after `authLogin` always ran the failure branch: they read a server action's
|
|
78
|
+
`status`. The message names what the step publishes and suggests testing `signedIn.ok` with `when`.
|
|
79
|
+
- **`explain` lists what a step publishes** (`Reads:`) and finds the auth steps by their builders (`authLogin`,
|
|
80
|
+
`authLogout`, `authRefreshDetails`). `authLogin({ username, password })` no longer needs `mode`.
|
|
81
|
+
|
|
82
|
+
## Elements
|
|
83
|
+
- **Images no longer default to a 140×140 square**: they are 140px wide and as tall as their ratio, so `width` or
|
|
84
|
+
`aspect-ratio` on a class just works. `object-fit` shows in the builder too.
|
|
85
|
+
- **`formControl` with `subType: 'switch'` renders an on/off switch** (`role="switch"`) — it rendered only its label.
|
|
86
|
+
Checkboxes and switches show a `true` default or binding as ticked.
|
|
87
|
+
- **The theme toggle drops the native button look**, and the **`current` style state covers the chosen item of any
|
|
88
|
+
set**: the link to the page shown, a pressed toggle, a selected tab. The exported `CURRENT_PAGE_SELECTOR` is now
|
|
89
|
+
`CURRENT_SELECTOR`.
|
|
90
|
+
- **Element defaults in the style inspector and the MCP catalogue match what the SDK renders**, held by a test. The
|
|
91
|
+
dialog's `bodyContainer` and `headerCloseButton` slots now reach the page; pagination lays out as declared.
|
|
92
|
+
- **Markdown takes a class for each part of the document** through its own slot (`heading`, `paragraph`, `link`,
|
|
93
|
+
`list`, `listItem`, `quote`, `code`, `codeBlock`, `image`, `table`, `anchor`), and `headingLinks: false` drops the
|
|
94
|
+
link each heading offers to itself while keeping its id, so `/page#anchor` links still work. Its description spells
|
|
95
|
+
out the HTML it outputs.
|
|
96
|
+
- **Tabs show every trigger.** The SDK hid every inactive tab item, the header's included, so a set of tabs showed
|
|
97
|
+
one tab and no way to the others; only the body's panels take turns now.
|
|
98
|
+
- **A link that names a query is current only on that query**: of `/?window=6h` and `/?window=24h`, the one shown
|
|
99
|
+
carries `aria-current` — with the path alone, every one of them did. A link with no query is still current on its
|
|
100
|
+
page whatever the query.
|
|
101
|
+
|
|
102
|
+
## The style language says what `customCss` used to
|
|
103
|
+
- **Pseudo-elements on a class**: `pseudos: { after: { css: { content: '"→"' }, states: { hover: { … } } } }` —
|
|
104
|
+
`before`, `after`, `marker`, `placeholder`, `first-letter`, `first-line`, `selection`, each in the class's states and
|
|
105
|
+
variants. Authoring refuses what draws nothing: a `before`/`after` with no `content`, a `content` without its quotes,
|
|
106
|
+
a property the browser drops on that pseudo-element.
|
|
107
|
+
- **Conditions on a class**: `conditions: { 'motion-reduce': { … }, 'container card (max-width: 30rem)': { … } }` —
|
|
108
|
+
reduced or allowed motion, and container widths, each with its states and pseudo-elements.
|
|
109
|
+
- **The space's `keyframes`**, validated and written at the top of `customCss`; an `animation-name` no keyframes declare
|
|
110
|
+
is warned (`animation-name-unknown`).
|
|
111
|
+
- **New states**: `expanded` (`aria-expanded`), `first`, `last`, `odd`, `even`; the tab panel on show is `current`, and
|
|
112
|
+
the theme toggle's icon of the scheme in use is `current` on its `icon` slot.
|
|
113
|
+
- **`ancestors['>']`** is the parent, whatever it wears — a closed component's part reacting to the element around it.
|
|
114
|
+
- The builder's style inspector, the MCP's definition ops (`pseudos`, `conditions`, and variants with their states) and
|
|
115
|
+
the export to code read and write all of it; an MCP `patchDefinition` no longer drops what it did not name. Rules in
|
|
116
|
+
`customCss` a class can hold now — `.link::after`, one under `@media (prefers-reduced-motion: reduce)`, `.row:first-child`,
|
|
117
|
+
`.row:nth-child(even)`, `.toggle[aria-expanded='true']` — are folded into the class on export and suggested by
|
|
118
|
+
`custom-css-class`.
|
|
119
|
+
|
|
120
|
+
## Elements take a class for each part
|
|
121
|
+
- **`formControl`**: `field` (the `<input>` itself), `icon` (the show-password button) and `requiredMark` slots; a switch's
|
|
122
|
+
knob reads in dark mode and takes `--plitzi-switch-thumb`, `--plitzi-switch-thumb-checked`, `--plitzi-switch-thumb-shadow`.
|
|
123
|
+
- **`pagination`**: `previous`, `page` (the one shown is its `current` state), `next`, `loadMore`.
|
|
124
|
+
- **`richText`** and **`markdown`**: a slot per part — `heading` and `heading1`…`heading6`, `strong`, `emphasis`,
|
|
125
|
+
`divider`, `tableHead`, `tableRow`, `tableHeaderCell`, `tableCell`, and the code block's frame, header, language and
|
|
126
|
+
copy button. Both heading slots dress one `<h3>`, so `heading-level-overridden` warns when they set the same property
|
|
127
|
+
and the stylesheet's order makes the general one win. A document is drawn by the SDK's own renderer
|
|
128
|
+
(`MarkdownDocument` in `@plitzi/sdk-elements`) — plitzi-ui's `Markdown` keeps GitHub's stylesheet for a library's
|
|
129
|
+
consumers — and reads as a document unstyled: headings, lists, code, tables and quotes get their type from the SDK's
|
|
130
|
+
base layer, at no weight (`:where()`), so a class on a part's slot replaces what it sets property by property. A
|
|
131
|
+
`richText` body reads the same.
|
|
132
|
+
- `custom-css-slot` suggests the slot for a `customCss` rule on a part's SDK class — only where a class on the slot can
|
|
133
|
+
say the rest of the selector (a state, a pseudo-element); `element-slot-unknown` warns of a slot an element does not
|
|
134
|
+
have.
|
|
135
|
+
|
|
136
|
+
## Links, refreshes and toasts
|
|
137
|
+
- **`current: 'section'` on a link** keeps it current on its page and every page under its path (`aria-current="true"`
|
|
138
|
+
there), styled by the `current` state — no `activeOn` binding for a section.
|
|
139
|
+
- **A refresh asks only about elements the page shown holds**: a provider on the page being left no longer sends a
|
|
140
|
+
`/_rsc` about the new address.
|
|
141
|
+
- **The toasts' parts are `notifications` fields**: `minHeight`, `fontWeight`, `lineHeight`, `iconSize`, `iconGap`,
|
|
142
|
+
`closeColor`, `closeOpacity`, `progressHeight`.
|
|
143
|
+
- **A page asked for with its space's token hydrates its own space.** On a host serving many spaces
|
|
144
|
+
(`?access-token=`), the space document fetched beside the page went without the token, so the host's own space
|
|
145
|
+
answered it and the browser hydrated another space's document over the page — a hydration error, and its tree
|
|
146
|
+
rebuilt. The document's address now carries the token the page was asked for with.
|
|
147
|
+
- **The SDK's stylesheet carries the space's variables from the server's HTML.** It read them from what a provider
|
|
148
|
+
below it publishes while the page renders, which the server had not done yet when it wrote the sheet; it now
|
|
149
|
+
resolves them from the document itself (`useResolvedVariables` of `@plitzi/sdk-shared/dataSource/hooks`), the same
|
|
150
|
+
on both sides.
|
|
151
|
+
- **A realtime message the pub/sub cannot deliver is answered, not fatal.** A publish that Redis refuses — a timeout under
|
|
152
|
+
load — is answered `503` with `reason: 'unavailable'`, by the `POST` and in the WebSocket's `ack` alike; a connect,
|
|
153
|
+
a disconnect or a revoke that fails is logged, on either transport. Each used to reject with nobody waiting, and the server's `unhandledRejection` handler
|
|
154
|
+
shut the whole process down.
|
|
155
|
+
|
|
156
|
+
## Reporting to Plitzi
|
|
157
|
+
- **`plitzi feedback`** starts a report of what broke, misled or cost time: it writes the page the report is laid out
|
|
158
|
+
in (`tmp/feedback/`) with the installed versions, the project and what `doctor` finds already in it, and tells the
|
|
159
|
+
agent how to fill it — each finding reproduced first, with evidence, impact, workaround and fix, no secrets — and to
|
|
160
|
+
publish it as an artifact whose link the developer sends. `--previous <url>` continues an earlier report.
|
|
161
|
+
|
|
162
|
+
## Pages that load on every browser
|
|
163
|
+
- **The import map comes before anything that loads a module**, in the page server's HTML, a published site's
|
|
164
|
+
(`index.hbs` on the platform), the SDK's and the builder's. React's `modulepreload` links came first, and a browser
|
|
165
|
+
that had fetched a module already — Chrome before 133 — ignored the map: every bare `import "react"` failed
|
|
166
|
+
("Failed to resolve module specifier") and the page never hydrated.
|
|
167
|
+
|
|
168
|
+
## The dev tools
|
|
169
|
+
- **A page loads the React its dev tools need.** The development build only while the visitor has the dev tools on
|
|
170
|
+
(shift+F12, within what the deployment allows); turned off, the next load is a production page, React included. It
|
|
171
|
+
followed the authorization alone, so a space that allowed debugging always shipped development React.
|
|
172
|
+
|
|
173
|
+
## check and lint
|
|
174
|
+
- **`plitzi check`, `push`, `lint` and `fix` hold the space to what `npm run author` and the server do**: its data
|
|
175
|
+
files too, so `push` no longer sends a space whose browser provider reads `src/data/` (`server-data-in-browser`).
|
|
176
|
+
- **`plitzi check` lists each list's rows as drawn and as held in its source** (`feed 4 of 8 rows`,
|
|
177
|
+
`hits not rendered (16 in its source)`). In `--json`, `lists` is now `{ id: { rendered, source } }`.
|
|
178
|
+
- **`plitzi check` no longer reports bindings inside a container the page isn't showing**, nor text "in the colour
|
|
179
|
+
behind it" because of a bar painted over it or a pane that clips it.
|
|
180
|
+
- **`window.__plitzi.sources()` no longer turns a shared array into `'[…]'`**, and a list row no longer replaces its
|
|
181
|
+
list's `items`.
|
|
182
|
+
- **`plitzi lint` says authoring suggestions are quieted with `quiet` on the element**, and reports a
|
|
183
|
+
`plitzi-lint-disable` comment that names one (`disable-names-suggestion`).
|
|
184
|
+
- **`plitzi check` says when a page sent the browser elsewhere** (a page for signed-in visitors, to the sign-in) instead
|
|
185
|
+
of reporting every element missing, and `--as <username>` signs in first through the server's `/auth` routes, the
|
|
186
|
+
password from `PLITZI_CHECK_PASSWORD`.
|
|
187
|
+
- **`plitzi upgrade` never replaces @plitzi packages installed locally** — a tarball, a link, a portal, an override: it
|
|
188
|
+
leaves them and the install, and says which and the command that would install the registry's.
|
|
189
|
+
- **`plitzi explain` covers every code**: authoring's, `plitzi lint`'s and the project layout's.
|
|
190
|
+
- **Authoring reads the global sources' fields**: `auth.authenticated` in a condition is refused with "did you mean
|
|
191
|
+
`isAuthenticated`?" (`global-field-unknown`), and `invalidateElements` must name providers that exist
|
|
192
|
+
(`element-ids-target`). A template's reads of `computed`, `flags` and the global sources come off the parsed
|
|
193
|
+
template: a string inside it (`'https://auth.acme.com'`) is no longer read as `auth.acme`.
|
|
194
|
+
- **`custom-css-notifications` no longer reads the rules `notifications` itself writes** as toasts dressed by hand.
|
|
195
|
+
- **A refused space or layout is a report, not a stack**: the server's entry point imports the space once the layout is
|
|
196
|
+
checked, and `npm start` and `npm run author` print every problem and exit with 1.
|
|
197
|
+
- **New authoring suggestion `class-overrides-class`**: one class's shorthand (`padding`) silently erases a longhand
|
|
198
|
+
(`padding-top`) another class on the same element writes out.
|
|
199
|
+
|
|
200
|
+
- Updated dependencies [c7bbc2b]
|
|
201
|
+
- @plitzi/sdk-auth@0.38.7
|
|
202
|
+
- @plitzi/sdk-event-bridge@0.38.7
|
|
203
|
+
- @plitzi/sdk-interactions@0.38.7
|
|
204
|
+
- @plitzi/sdk-navigation@0.38.7
|
|
205
|
+
- @plitzi/sdk-schema@0.38.7
|
|
206
|
+
- @plitzi/sdk-shared@0.38.7
|
|
207
|
+
|
|
3
208
|
## 0.38.6
|
|
4
209
|
|
|
5
210
|
### Patch Changes
|
|
@@ -16,7 +16,7 @@ declare const useRscData: <T>() => {
|
|
|
16
16
|
isServerElement: boolean;
|
|
17
17
|
/** A refresh asking about this element — or about the whole payload of this page — is in flight. */
|
|
18
18
|
refreshing: boolean;
|
|
19
|
-
refresh: (ids?: string[], params?: Record<string, string>) => Promise<void>;
|
|
19
|
+
refresh: (ids?: string[], params?: Record<string, string>, { fresh }?: Pick<import('@plitzi/sdk-shared').RscRefreshOptions, "fresh">) => Promise<void>;
|
|
20
20
|
/** Stops this element's refresh in flight, here and on the server; what it shows stays. */
|
|
21
21
|
cancel: () => void;
|
|
22
22
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { MarkdownClassNames } from './helpers/markdownParts';
|
|
2
|
+
import { HeadingAnchor } from './helpers/rehypeHeadingAnchors';
|
|
3
|
+
export type MarkdownDocumentProps = {
|
|
4
|
+
className?: string;
|
|
5
|
+
children?: string;
|
|
6
|
+
wrapLines?: boolean;
|
|
7
|
+
showLineNumbers?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* The id each heading carries, so `#id` lands on it — asked once per heading, in order, with the ids already given.
|
|
10
|
+
* Without it a heading carries none and offers no link to itself.
|
|
11
|
+
*/
|
|
12
|
+
headingAnchor?: HeadingAnchor;
|
|
13
|
+
/**
|
|
14
|
+
* Whether a heading that has an id offers a link to itself (`a.anchor`) before its words. `false` keeps the ids — a
|
|
15
|
+
* `#id` still lands on the heading — and leaves the link out.
|
|
16
|
+
*/
|
|
17
|
+
headingLinks?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* A class for each part of the output, beside the one it already has: `{ heading: 'doc-heading', link: 'doc-link' }`
|
|
20
|
+
* — the parts are `MARKDOWN_PARTS`. The output carries no stylesheet of its own beyond the code blocks' highlighting:
|
|
21
|
+
* the SDK's base layer gives an undressed document its type (`_document.scss`), below every class.
|
|
22
|
+
* Keep it the same object from one render to the next: a new one rebuilds every tag of the document.
|
|
23
|
+
*/
|
|
24
|
+
classNames?: MarkdownClassNames;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* A Markdown source (GitHub-flavoured) as HTML, inside a `div.markdown`, each part of it with the class the consumer
|
|
28
|
+
* gives it — the SDK's own copy of plitzi-ui's `Markdown`, which ships GitHub's stylesheet for a library's consumers:
|
|
29
|
+
* here the space dresses every part, and a stylesheet of its own would win over what the space writes.
|
|
30
|
+
*/
|
|
31
|
+
declare const MarkdownDocument: ({ className, children, wrapLines, showLineNumbers, headingAnchor, headingLinks, classNames }: MarkdownDocumentProps) => import('react').JSX.Element;
|
|
32
|
+
export default MarkdownDocument;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { markdownComponents as e } from "./helpers/markdownComponents.mjs";
|
|
2
|
+
import { rehypeHeadingAnchors as t } from "./helpers/rehypeHeadingAnchors.mjs";
|
|
3
|
+
import { useMemo as n } from "react";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
import i from "clsx";
|
|
6
|
+
import a from "react-markdown";
|
|
7
|
+
import o from "remark-gfm";
|
|
8
|
+
//#region src/components/MarkdownDocument/MarkdownDocument.tsx
|
|
9
|
+
var s = {}, c = [o], l = ({ className: o, children: l = "", wrapLines: u = !0, showLineNumbers: d = !0, headingAnchor: f, headingLinks: p = !0, classNames: m = s }) => {
|
|
10
|
+
let h = n(() => f ? [t(f)] : [], [f]), g = n(() => e({
|
|
11
|
+
classNames: m,
|
|
12
|
+
headingLinks: p,
|
|
13
|
+
wrapLines: u,
|
|
14
|
+
showLineNumbers: d
|
|
15
|
+
}), [
|
|
16
|
+
m,
|
|
17
|
+
p,
|
|
18
|
+
u,
|
|
19
|
+
d
|
|
20
|
+
]);
|
|
21
|
+
return /* @__PURE__ */ r("div", {
|
|
22
|
+
className: i("markdown", o),
|
|
23
|
+
children: /* @__PURE__ */ r(a, {
|
|
24
|
+
remarkPlugins: c,
|
|
25
|
+
rehypePlugins: h,
|
|
26
|
+
components: g,
|
|
27
|
+
children: l
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { l as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MarkdownClassNames } from '../../helpers/markdownParts';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export type CodeBlockProps = {
|
|
4
|
+
/** The language the block is written in, as its fence named it. */
|
|
5
|
+
language?: string;
|
|
6
|
+
/** The block's text, as it is copied. */
|
|
7
|
+
code: string;
|
|
8
|
+
/** The classes of the frame's parts — `codeBlockFrame`, `codeBlockHeader`, `codeBlockLanguage`, `codeBlockCopy`. */
|
|
9
|
+
classNames: MarkdownClassNames;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
/** A fenced block with what it is written in and a way to take it: a header over the code itself. */
|
|
13
|
+
declare const CodeBlock: ({ language, code, classNames, children }: CodeBlockProps) => import('react').JSX.Element;
|
|
14
|
+
export default CodeBlock;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useCallback as e, useEffect as t, useState as n } from "react";
|
|
2
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
3
|
+
import a from "clsx";
|
|
4
|
+
//#region src/components/MarkdownDocument/components/CodeBlock/CodeBlock.tsx
|
|
5
|
+
var o = 2e3, s = ({ language: s, code: c, classNames: l, children: u }) => {
|
|
6
|
+
let [d, f] = n(!1);
|
|
7
|
+
t(() => {
|
|
8
|
+
if (!d) return;
|
|
9
|
+
let e = setTimeout(() => f(!1), o);
|
|
10
|
+
return () => clearTimeout(e);
|
|
11
|
+
}, [d]);
|
|
12
|
+
let p = e(() => {
|
|
13
|
+
navigator.clipboard.writeText(c).then(() => f(!0));
|
|
14
|
+
}, [c]);
|
|
15
|
+
return /* @__PURE__ */ i("div", {
|
|
16
|
+
className: a("markdown-code", l.codeBlockFrame),
|
|
17
|
+
"data-language": s,
|
|
18
|
+
children: [/* @__PURE__ */ i("div", {
|
|
19
|
+
className: a("markdown-code-header", l.codeBlockHeader),
|
|
20
|
+
children: [/* @__PURE__ */ r("span", {
|
|
21
|
+
className: a("markdown-code-language", l.codeBlockLanguage),
|
|
22
|
+
children: s ?? "text"
|
|
23
|
+
}), /* @__PURE__ */ r("button", {
|
|
24
|
+
type: "button",
|
|
25
|
+
className: a("markdown-code-copy", l.codeBlockCopy),
|
|
26
|
+
onClick: p,
|
|
27
|
+
"aria-live": "polite",
|
|
28
|
+
children: d ? "Copied" : "Copy"
|
|
29
|
+
})]
|
|
30
|
+
}), u]
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { s as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** The part of a syntax-tree node this package reads: its words, and the nodes under it. */
|
|
2
|
+
export type HastNode = {
|
|
3
|
+
type: string;
|
|
4
|
+
tagName?: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
properties?: Record<string, unknown>;
|
|
7
|
+
children?: HastNode[];
|
|
8
|
+
};
|
|
9
|
+
/** The words under a node, as a reader sees them: text only — a picture's alt and raw HTML are not text. */
|
|
10
|
+
export declare const hastText: (node: HastNode) => string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MarkdownClassNames } from './markdownParts';
|
|
2
|
+
import { Components } from 'react-markdown';
|
|
3
|
+
export type MarkdownComponentsOptions = {
|
|
4
|
+
classNames: MarkdownClassNames;
|
|
5
|
+
headingLinks: boolean;
|
|
6
|
+
wrapLines: boolean;
|
|
7
|
+
showLineNumbers: boolean;
|
|
8
|
+
};
|
|
9
|
+
/** What each tag of a Markdown source is written as: its parts' classes, the headings' links and the code blocks. */
|
|
10
|
+
export declare const markdownComponents: (options: MarkdownComponentsOptions) => Components;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { hastText as e } from "./hastText.mjs";
|
|
2
|
+
import { SyntaxHighlighter as t } from "./syntaxHighlighter.mjs";
|
|
3
|
+
import n from "../components/CodeBlock/index.mjs";
|
|
4
|
+
import { createElement as r } from "react";
|
|
5
|
+
import { omit as i } from "@plitzi/plitzi-ui/helpers";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
import s from "clsx";
|
|
8
|
+
import c from "react-syntax-highlighter/dist/esm/styles/prism/vsc-dark-plus";
|
|
9
|
+
//#region src/components/MarkdownDocument/helpers/markdownComponents.tsx
|
|
10
|
+
var l = {
|
|
11
|
+
h1: "heading1",
|
|
12
|
+
h2: "heading2",
|
|
13
|
+
h3: "heading3",
|
|
14
|
+
h4: "heading4",
|
|
15
|
+
h5: "heading5",
|
|
16
|
+
h6: "heading6"
|
|
17
|
+
}, u = /language-(\w+)/, d = (e, t) => ({ className: n, ...a }) => r(e, {
|
|
18
|
+
...i(a, ["node"]),
|
|
19
|
+
className: s(n, t) || void 0
|
|
20
|
+
}), f = (t, { classNames: n, headingLinks: r }) => ({ children: i, node: c, className: u, ...d }) => /* @__PURE__ */ o(t, {
|
|
21
|
+
...d,
|
|
22
|
+
className: s(u, n.heading, n[l[t]]) || void 0,
|
|
23
|
+
children: [r && d.id && /* @__PURE__ */ a("a", {
|
|
24
|
+
className: s("anchor", n.anchor),
|
|
25
|
+
href: `#${d.id}`,
|
|
26
|
+
"aria-label": `Link to “${c ? e(c) : d.id}”`,
|
|
27
|
+
children: /* @__PURE__ */ a("span", {
|
|
28
|
+
className: "octicon octicon-link",
|
|
29
|
+
"aria-hidden": "true"
|
|
30
|
+
})
|
|
31
|
+
}), i]
|
|
32
|
+
}), p = (r) => {
|
|
33
|
+
let { classNames: o, wrapLines: l, showLineNumbers: p } = r;
|
|
34
|
+
return {
|
|
35
|
+
h1: f("h1", r),
|
|
36
|
+
h2: f("h2", r),
|
|
37
|
+
h3: f("h3", r),
|
|
38
|
+
h4: f("h4", r),
|
|
39
|
+
h5: f("h5", r),
|
|
40
|
+
h6: f("h6", r),
|
|
41
|
+
p: d("p", o.paragraph),
|
|
42
|
+
a: d("a", o.link),
|
|
43
|
+
strong: d("strong", o.strong),
|
|
44
|
+
em: d("em", o.emphasis),
|
|
45
|
+
ul: d("ul", o.list),
|
|
46
|
+
ol: d("ol", o.list),
|
|
47
|
+
li: d("li", o.listItem),
|
|
48
|
+
blockquote: d("blockquote", o.quote),
|
|
49
|
+
hr: d("hr", o.divider),
|
|
50
|
+
img: d("img", o.image),
|
|
51
|
+
table: d("table", o.table),
|
|
52
|
+
thead: d("thead", o.tableHead),
|
|
53
|
+
tr: d("tr", o.tableRow),
|
|
54
|
+
th: d("th", o.tableHeaderCell),
|
|
55
|
+
td: d("td", o.tableCell),
|
|
56
|
+
pre: ({ children: t, node: r, className: i, ...c }) => {
|
|
57
|
+
let l = /* @__PURE__ */ a("pre", {
|
|
58
|
+
...c,
|
|
59
|
+
className: s(i, o.codeBlock) || void 0,
|
|
60
|
+
children: t
|
|
61
|
+
}), d = r?.children.find((e) => e.type === "element" && e.tagName === "code");
|
|
62
|
+
if (!d || d.type !== "element") return l;
|
|
63
|
+
let f = d.properties.className, p = Array.isArray(f) ? f.map(String).map((e) => u.exec(e)?.[1]).find(Boolean) : void 0;
|
|
64
|
+
return /* @__PURE__ */ a(n, {
|
|
65
|
+
language: p,
|
|
66
|
+
code: e(d).replace(/\n$/, ""),
|
|
67
|
+
classNames: o,
|
|
68
|
+
children: l
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
code: ({ children: e, className: n, ...r }) => {
|
|
72
|
+
let d = i(r, ["node"]), f = u.exec(n || "");
|
|
73
|
+
return f ? /* @__PURE__ */ a(t, {
|
|
74
|
+
PreTag: "div",
|
|
75
|
+
language: f[1],
|
|
76
|
+
style: c,
|
|
77
|
+
wrapLines: l,
|
|
78
|
+
showLineNumbers: p,
|
|
79
|
+
children: typeof e == "string" ? e.replace(/\n$/, "") : ""
|
|
80
|
+
}) : /* @__PURE__ */ a("code", {
|
|
81
|
+
...d,
|
|
82
|
+
className: s(n, o.code) || void 0,
|
|
83
|
+
children: e
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
//#endregion
|
|
89
|
+
export { p as markdownComponents };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The parts of the HTML a Markdown source is written as, each of which can carry a class of the consumer's own.
|
|
3
|
+
*
|
|
4
|
+
* - `heading` is every heading, `h1`–`h6`; `heading1`…`heading6` is the one of that level, beside it.
|
|
5
|
+
* - `paragraph` (`p`), `link` (`a`), `strong` (`strong`), `emphasis` (`em`), `list` (`ul`/`ol`), `listItem` (`li`),
|
|
6
|
+
* `quote` (`blockquote`), `divider` (`hr`), `image` (`img`).
|
|
7
|
+
* - `code` is inline `code`; `codeBlock` the `pre` of a fenced block, inside its frame (`div.markdown-code`,
|
|
8
|
+
* `codeBlockFrame`) under a header (`div.markdown-code-header`, `codeBlockHeader`) that holds its language
|
|
9
|
+
* (`span.markdown-code-language`, `codeBlockLanguage`) and its copy button (`button.markdown-code-copy`,
|
|
10
|
+
* `codeBlockCopy`).
|
|
11
|
+
* - `table`, `tableHead` (`thead`), `tableRow` (`tr`), `tableHeaderCell` (`th`), `tableCell` (`td`).
|
|
12
|
+
* - `anchor` is the link a heading offers to itself.
|
|
13
|
+
*/
|
|
14
|
+
export declare const MARKDOWN_PARTS: readonly ["heading", "heading1", "heading2", "heading3", "heading4", "heading5", "heading6", "paragraph", "link", "strong", "emphasis", "list", "listItem", "quote", "divider", "code", "codeBlock", "codeBlockFrame", "codeBlockHeader", "codeBlockLanguage", "codeBlockCopy", "image", "table", "tableHead", "tableRow", "tableHeaderCell", "tableCell", "anchor"];
|
|
15
|
+
export type MarkdownPart = (typeof MARKDOWN_PARTS)[number];
|
|
16
|
+
export type MarkdownClassNames = Partial<Record<MarkdownPart, string>>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region src/components/MarkdownDocument/helpers/markdownParts.ts
|
|
2
|
+
var e = /* @__PURE__ */ "heading.heading1.heading2.heading3.heading4.heading5.heading6.paragraph.link.strong.emphasis.list.listItem.quote.divider.code.codeBlock.codeBlockFrame.codeBlockHeader.codeBlockLanguage.codeBlockCopy.image.table.tableHead.tableRow.tableHeaderCell.tableCell.anchor".split(".");
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as MARKDOWN_PARTS };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HastNode } from './hastText';
|
|
2
|
+
/** What decides a heading's id: its words, and the ids the document has already given. */
|
|
3
|
+
export type HeadingAnchor = (text: string, taken: Set<string>) => string;
|
|
4
|
+
/**
|
|
5
|
+
* Gives every heading the id `anchor` answers for its words, in document order — once per parse, so a heading keeps its
|
|
6
|
+
* id however many times React renders it.
|
|
7
|
+
*/
|
|
8
|
+
export declare const rehypeHeadingAnchors: (anchor: HeadingAnchor) => () => (tree: HastNode) => void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { hastText as e } from "./hastText.mjs";
|
|
2
|
+
//#region src/components/MarkdownDocument/helpers/rehypeHeadingAnchors.ts
|
|
3
|
+
var t = /* @__PURE__ */ new Set([
|
|
4
|
+
"h1",
|
|
5
|
+
"h2",
|
|
6
|
+
"h3",
|
|
7
|
+
"h4",
|
|
8
|
+
"h5",
|
|
9
|
+
"h6"
|
|
10
|
+
]), n = (n) => () => (r) => {
|
|
11
|
+
let i = /* @__PURE__ */ new Set(), a = (r) => {
|
|
12
|
+
r.type === "element" && r.tagName && t.has(r.tagName) && (r.properties = {
|
|
13
|
+
...r.properties,
|
|
14
|
+
id: n(e(r).trim(), i)
|
|
15
|
+
}), r.children?.forEach(a);
|
|
16
|
+
};
|
|
17
|
+
a(r);
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { n as rehypeHeadingAnchors };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { PrismLight as e } from "react-syntax-highlighter";
|
|
2
|
+
import t from "react-syntax-highlighter/dist/esm/languages/prism/bash";
|
|
3
|
+
import n from "react-syntax-highlighter/dist/esm/languages/prism/css";
|
|
4
|
+
import r from "react-syntax-highlighter/dist/esm/languages/prism/javascript";
|
|
5
|
+
import i from "react-syntax-highlighter/dist/esm/languages/prism/json";
|
|
6
|
+
import a from "react-syntax-highlighter/dist/esm/languages/prism/jsx";
|
|
7
|
+
import o from "react-syntax-highlighter/dist/esm/languages/prism/markup";
|
|
8
|
+
import s from "react-syntax-highlighter/dist/esm/languages/prism/tsx";
|
|
9
|
+
import c from "react-syntax-highlighter/dist/esm/languages/prism/typescript";
|
|
10
|
+
//#region src/components/MarkdownDocument/helpers/syntaxHighlighter.ts
|
|
11
|
+
var l = (e) => typeof e == "object" && e && "default" in e ? e.default : e, u = {
|
|
12
|
+
javascript: r,
|
|
13
|
+
typescript: c,
|
|
14
|
+
jsx: a,
|
|
15
|
+
tsx: s,
|
|
16
|
+
bash: t,
|
|
17
|
+
json: i,
|
|
18
|
+
css: n,
|
|
19
|
+
html: o,
|
|
20
|
+
markdown: o
|
|
21
|
+
};
|
|
22
|
+
for (let [t, n] of Object.entries(u)) e.registerLanguage(t, l(n));
|
|
23
|
+
//#endregion
|
|
24
|
+
export { e as SyntaxHighlighter };
|