@editora/ui-core 0.1.22 → 0.1.23
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/README.md +292 -221
- package/dist/{ElementBase-YlTLMsGk.mjs → ElementBase-BeZT54Hj.mjs} +3 -2
- package/dist/ElementBase-DxbvhLJs.js +1 -0
- package/dist/ElementBase.d.ts +2 -1
- package/dist/ElementBase.d.ts.map +1 -1
- package/dist/__tests__/setup.d.ts +0 -2
- package/dist/__tests__/setup.d.ts.map +1 -1
- package/dist/accordion.cjs.js +1 -1
- package/dist/accordion.esm.js +1 -1
- package/dist/alert-dialog.cjs.js +1 -1
- package/dist/alert-dialog.esm.js +1 -1
- package/dist/alert.cjs.js +1 -1
- package/dist/alert.esm.js +1 -1
- package/dist/anchor.cjs.js +3 -3
- package/dist/anchor.esm.js +6 -5
- package/dist/animated-beam.cjs.js +1 -1
- package/dist/animated-beam.esm.js +1 -1
- package/dist/animated-list.cjs.js +1 -1
- package/dist/animated-list.esm.js +1 -1
- package/dist/animated-text.cjs.js +1 -1
- package/dist/animated-text.esm.js +1 -1
- package/dist/app-header.cjs.js +1 -1
- package/dist/app-header.esm.js +1 -1
- package/dist/aspect-ratio.cjs.js +1 -1
- package/dist/aspect-ratio.esm.js +1 -1
- package/dist/avatar.cjs.js +1 -1
- package/dist/avatar.esm.js +1 -1
- package/dist/badge.cjs.js +1 -1
- package/dist/badge.esm.js +1 -1
- package/dist/block-controls.cjs.js +1 -1
- package/dist/block-controls.esm.js +1 -1
- package/dist/box.cjs.js +1 -1
- package/dist/box.esm.js +1 -1
- package/dist/breadcrumb.cjs.js +1 -1
- package/dist/breadcrumb.esm.js +1 -1
- package/dist/button.cjs.js +1 -1
- package/dist/button.esm.js +1 -1
- package/dist/{calendar-DbxYRdlv.mjs → calendar-B3PUKHQm.mjs} +1 -1
- package/dist/{calendar-Qa-cFOp3.js → calendar-D-mXMgqc.js} +1 -1
- package/dist/calendar.cjs.js +1 -1
- package/dist/calendar.esm.js +1 -1
- package/dist/card.cjs.js +1 -1
- package/dist/card.esm.js +1 -1
- package/dist/chart.cjs.js +1 -1
- package/dist/chart.esm.js +1 -1
- package/dist/checkbox.cjs.js +1 -1
- package/dist/checkbox.esm.js +1 -1
- package/dist/collapsible.cjs.js +1 -1
- package/dist/collapsible.esm.js +1 -1
- package/dist/collection.cjs.js +1 -1
- package/dist/collection.esm.js +9 -8
- package/dist/color-picker.cjs.js +4 -4
- package/dist/color-picker.esm.js +3 -3
- package/dist/combobox.cjs.js +1 -1
- package/dist/combobox.esm.js +1 -1
- package/dist/command-palette.cjs.js +1 -1
- package/dist/command-palette.esm.js +1 -1
- package/dist/command.cjs.js +1 -1
- package/dist/command.esm.js +1 -1
- package/dist/components/ui-anchor.d.ts +2 -1
- package/dist/components/ui-anchor.d.ts.map +1 -1
- package/dist/components/ui-button.d.ts.map +1 -1
- package/dist/components/ui-collection.d.ts +2 -1
- package/dist/components/ui-collection.d.ts.map +1 -1
- package/dist/components/ui-form.d.ts +1 -0
- package/dist/components/ui-form.d.ts.map +1 -1
- package/dist/components/ui-roving-focus-group.d.ts +2 -1
- package/dist/components/ui-roving-focus-group.d.ts.map +1 -1
- package/dist/components/ui-sortable.d.ts.map +1 -1
- package/dist/container.cjs.js +1 -1
- package/dist/container.esm.js +1 -1
- package/dist/context-menu.cjs.js +1 -1
- package/dist/context-menu.esm.js +1 -1
- package/dist/control-group.cjs.js +1 -1
- package/dist/control-group.esm.js +1 -1
- package/dist/data-table.cjs.js +1 -1
- package/dist/data-table.esm.js +1 -1
- package/dist/date-field.cjs.js +1 -1
- package/dist/date-field.esm.js +3 -3
- package/dist/date-picker.cjs.js +1 -1
- package/dist/date-picker.esm.js +3 -3
- package/dist/date-range-picker.cjs.js +1 -1
- package/dist/date-range-picker.esm.js +3 -3
- package/dist/date-range-time-picker.cjs.js +1 -1
- package/dist/date-range-time-picker.esm.js +3 -3
- package/dist/date-time-picker.cjs.js +1 -1
- package/dist/date-time-picker.esm.js +3 -3
- package/dist/{date-time-utils-Cps2aSu2.mjs → date-time-utils-BTlxnz5j.mjs} +1 -1
- package/dist/{date-time-utils-BzfTpeU-.js → date-time-utils-y3AvNvGe.js} +1 -1
- package/dist/description.cjs.js +1 -1
- package/dist/description.esm.js +1 -1
- package/dist/dialog.cjs.js +1 -1
- package/dist/dialog.esm.js +1 -1
- package/dist/direction-provider.cjs.js +1 -1
- package/dist/direction-provider.esm.js +1 -1
- package/dist/dismissable-layer.cjs.js +1 -1
- package/dist/dismissable-layer.esm.js +1 -1
- package/dist/dock.cjs.js +1 -1
- package/dist/dock.esm.js +1 -1
- package/dist/domElement-DazSZBjV.js +1 -0
- package/dist/domElement-ZlSGVP0l.mjs +5 -0
- package/dist/domElement.d.ts +2 -0
- package/dist/domElement.d.ts.map +1 -0
- package/dist/drawer.cjs.js +1 -1
- package/dist/drawer.esm.js +1 -1
- package/dist/dropdown.cjs.js +1 -1
- package/dist/dropdown.esm.js +1 -1
- package/dist/empty-state.cjs.js +1 -1
- package/dist/empty-state.esm.js +1 -1
- package/dist/field-error.cjs.js +1 -1
- package/dist/field-error.esm.js +1 -1
- package/dist/field.cjs.js +1 -1
- package/dist/field.esm.js +1 -1
- package/dist/fieldset.cjs.js +1 -1
- package/dist/fieldset.esm.js +1 -1
- package/dist/file-upload.cjs.js +1 -1
- package/dist/file-upload.esm.js +1 -1
- package/dist/flex.cjs.js +1 -1
- package/dist/flex.esm.js +1 -1
- package/dist/floating-toolbar.cjs.js +1 -1
- package/dist/floating-toolbar.esm.js +1 -1
- package/dist/focus-scope.cjs.js +1 -1
- package/dist/focus-scope.esm.js +1 -1
- package/dist/form.cjs.js +2 -2
- package/dist/form.esm.js +12 -2
- package/dist/gantt.cjs.js +1 -1
- package/dist/gantt.esm.js +1 -1
- package/dist/grid.cjs.js +1 -1
- package/dist/grid.esm.js +1 -1
- package/dist/hover-card.cjs.js +1 -1
- package/dist/hover-card.esm.js +1 -1
- package/dist/icon-cloud.cjs.js +1 -1
- package/dist/icon-cloud.esm.js +1 -1
- package/dist/icon.cjs.js +1 -1
- package/dist/icon.esm.js +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +6 -6
- package/dist/inline-edit.cjs.js +1 -1
- package/dist/inline-edit.esm.js +1 -1
- package/dist/input.cjs.js +1 -1
- package/dist/input.esm.js +1 -1
- package/dist/label.cjs.js +1 -1
- package/dist/label.esm.js +1 -1
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.esm.js +1 -1
- package/dist/marquee.cjs.js +1 -1
- package/dist/marquee.esm.js +1 -1
- package/dist/masonry-grid.cjs.js +1 -1
- package/dist/masonry-grid.esm.js +1 -1
- package/dist/menu.cjs.js +1 -1
- package/dist/menu.esm.js +1 -1
- package/dist/menubar.cjs.js +1 -1
- package/dist/menubar.esm.js +1 -1
- package/dist/meter.cjs.js +1 -1
- package/dist/meter.esm.js +1 -1
- package/dist/multi-select.cjs.js +1 -1
- package/dist/multi-select.esm.js +1 -1
- package/dist/navigation-menu.cjs.js +1 -1
- package/dist/navigation-menu.esm.js +1 -1
- package/dist/number-field.cjs.js +2 -2
- package/dist/number-field.esm.js +2 -2
- package/dist/number-ticker.cjs.js +1 -1
- package/dist/number-ticker.esm.js +1 -1
- package/dist/odometer.cjs.js +1 -1
- package/dist/odometer.esm.js +1 -1
- package/dist/orbiter.cjs.js +1 -1
- package/dist/orbiter.esm.js +1 -1
- package/dist/pagination.cjs.js +1 -1
- package/dist/pagination.esm.js +1 -1
- package/dist/{panel-group-CaD0_KQf.js → panel-group-BVHJEdfx.js} +1 -1
- package/dist/{panel-group-8sVNnGxg.mjs → panel-group-BxO_eNW6.mjs} +1 -1
- package/dist/panel-group.cjs.js +1 -1
- package/dist/panel-group.esm.js +1 -1
- package/dist/panel.cjs.js +1 -1
- package/dist/panel.esm.js +1 -1
- package/dist/password-field.cjs.js +1 -1
- package/dist/password-field.esm.js +1 -1
- package/dist/pin-input.cjs.js +1 -1
- package/dist/pin-input.esm.js +1 -1
- package/dist/placement-grid.cjs.js +1 -1
- package/dist/placement-grid.esm.js +1 -1
- package/dist/plugin-panel.cjs.js +1 -1
- package/dist/plugin-panel.esm.js +1 -1
- package/dist/popover.cjs.js +1 -1
- package/dist/popover.esm.js +1 -1
- package/dist/portal.cjs.js +1 -1
- package/dist/portal.esm.js +1 -1
- package/dist/positioner.cjs.js +1 -1
- package/dist/positioner.esm.js +1 -1
- package/dist/presence.cjs.js +1 -1
- package/dist/presence.esm.js +1 -1
- package/dist/progress.cjs.js +1 -1
- package/dist/progress.esm.js +1 -1
- package/dist/quick-actions.cjs.js +1 -1
- package/dist/quick-actions.esm.js +1 -1
- package/dist/radio-group.cjs.js +1 -1
- package/dist/radio-group.esm.js +1 -1
- package/dist/radio.cjs.js +1 -1
- package/dist/radio.esm.js +1 -1
- package/dist/rating.cjs.js +1 -1
- package/dist/rating.esm.js +1 -1
- package/dist/roving-focus-group.cjs.js +1 -1
- package/dist/roving-focus-group.esm.js +11 -10
- package/dist/scroll-area.cjs.js +1 -1
- package/dist/scroll-area.esm.js +1 -1
- package/dist/section.cjs.js +1 -1
- package/dist/section.esm.js +1 -1
- package/dist/select.cjs.js +1 -1
- package/dist/select.esm.js +1 -1
- package/dist/selection-popup.cjs.js +1 -1
- package/dist/selection-popup.esm.js +1 -1
- package/dist/separator.cjs.js +1 -1
- package/dist/separator.esm.js +1 -1
- package/dist/sidebar.cjs.js +2 -2
- package/dist/sidebar.esm.js +9 -9
- package/dist/skeleton.cjs.js +1 -1
- package/dist/skeleton.esm.js +1 -1
- package/dist/slider.cjs.js +1 -1
- package/dist/slider.esm.js +1 -1
- package/dist/slot.cjs.js +1 -1
- package/dist/slot.esm.js +1 -1
- package/dist/sortable.cjs.js +2 -2
- package/dist/sortable.esm.js +2 -2
- package/dist/spinning-text.cjs.js +1 -1
- package/dist/spinning-text.esm.js +1 -1
- package/dist/split-button.cjs.js +1 -1
- package/dist/split-button.esm.js +1 -1
- package/dist/splitter.cjs.js +1 -1
- package/dist/splitter.esm.js +1 -1
- package/dist/stepper.cjs.js +1 -1
- package/dist/stepper.esm.js +1 -1
- package/dist/switch.cjs.js +1 -1
- package/dist/switch.esm.js +1 -1
- package/dist/table.cjs.js +1 -1
- package/dist/table.esm.js +1 -1
- package/dist/tabs.cjs.js +1 -1
- package/dist/tabs.esm.js +1 -1
- package/dist/tags-input.cjs.js +1 -1
- package/dist/tags-input.esm.js +1 -1
- package/dist/textarea.cjs.js +1 -1
- package/dist/textarea.esm.js +1 -1
- package/dist/time-field.cjs.js +1 -1
- package/dist/time-field.esm.js +2 -2
- package/dist/time-picker.cjs.js +1 -1
- package/dist/time-picker.esm.js +3 -3
- package/dist/timeline.cjs.js +1 -1
- package/dist/timeline.esm.js +1 -1
- package/dist/toast.cjs.js +1 -1
- package/dist/toast.esm.js +1 -1
- package/dist/toggle-group.cjs.js +1 -1
- package/dist/toggle-group.esm.js +1 -1
- package/dist/toggle.cjs.js +1 -1
- package/dist/toggle.esm.js +1 -1
- package/dist/toolbar.cjs.js +1 -1
- package/dist/toolbar.esm.js +1 -1
- package/dist/tooltip.cjs.js +1 -1
- package/dist/tooltip.esm.js +1 -1
- package/dist/transfer-list.cjs.js +1 -1
- package/dist/transfer-list.esm.js +1 -1
- package/dist/{tree-Deoft-kO.mjs → tree-B_oQput6.mjs} +1 -1
- package/dist/{tree-7qbVnpGp.js → tree-SivHxcAy.js} +1 -1
- package/dist/tree-item.cjs.js +1 -1
- package/dist/tree-item.esm.js +1 -1
- package/dist/tree.cjs.js +1 -1
- package/dist/tree.esm.js +1 -1
- package/dist/{ui-button-BInsgSbr.js → ui-button-BPrzJScZ.js} +5 -5
- package/dist/{ui-button-rfiuUnUD.mjs → ui-button-Co8Sid6t.mjs} +11 -7
- package/dist/{ui-icon-Bvt9oIIR.js → ui-icon-D3avtxX_.js} +1 -1
- package/dist/{ui-icon-BSi_GtqO.mjs → ui-icon-DLhB08Fo.mjs} +1 -1
- package/dist/visually-hidden.cjs.js +1 -1
- package/dist/visually-hidden.esm.js +1 -1
- package/dist/wizard.cjs.js +1 -1
- package/dist/wizard.esm.js +1 -1
- package/package.json +2 -2
- package/dist/ElementBase-EV6mVBUV.js +0 -1
package/README.md
CHANGED
|
@@ -1,55 +1,120 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">@editora/ui-core</h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
More than a hundred web components for building application UIs: forms, data tables, dialogs, charts, a Gantt chart
|
|
5
|
+
and more. Standard custom elements, so they work in plain HTML, React, Vue, Svelte and Angular, with promise-based
|
|
6
|
+
dialogs, theming and positioning helpers.
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://www.npmjs.com/package/@editora/ui-core"><img src="https://img.shields.io/npm/v/@editora/ui-core.svg" alt="npm version"></a>
|
|
11
|
+
<a href="https://www.npmjs.com/package/@editora/ui-core"><img src="https://img.shields.io/npm/dm/@editora/ui-core.svg" alt="npm downloads"></a>
|
|
12
|
+
<a href="https://github.com/ajaykr089/Editora/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@editora/ui-core.svg" alt="license"></a>
|
|
13
|
+
<a href="https://www.npmjs.com/package/@editora/ui-core"><img src="https://img.shields.io/npm/types/@editora/ui-core.svg" alt="TypeScript types included"></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<a href="https://editora-ecosystem.netlify.app/">Component catalog</a> ·
|
|
18
|
+
<a href="https://editora-ecosystem-storybook.netlify.app/">Storybook</a> ·
|
|
19
|
+
<a href="https://codesandbox.io/p/github/ajaykr089/editora-codesandbox/main">CodeSandbox</a> ·
|
|
20
|
+
<a href="https://github.com/ajaykr089/Editora">GitHub</a>
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
<p align="center">
|
|
24
|
+
<img src="https://raw.githubusercontent.com/ajaykr089/Editora/main/packages/ui-core/docs/images/components.png" alt="A set of components: a labelled text field, buttons, badges and avatars, a warning alert, a switch, a checkbox, a progress bar and a date picker" width="900">
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
## Features
|
|
28
|
+
|
|
29
|
+
- **A broad catalog.** Inputs and forms, pickers, tables, tabs, menus, dialogs, drawers, charts, a calendar and a
|
|
30
|
+
Gantt planner: [the full list](#components).
|
|
31
|
+
- **Standard custom elements.** Use them from any framework, or with no framework and no build step.
|
|
32
|
+
- **Forms that validate.** `<ui-form>` collects the values of the controls inside it, validates them and reports
|
|
33
|
+
`submit`, `invalid` and `dirty-change`.
|
|
34
|
+
- **Promise-based dialogs.** `await dialogs.confirm({...})` instead of wiring open/close state.
|
|
35
|
+
- **Themeable** with design tokens, for the whole page or for one element.
|
|
36
|
+
- **Positioning helpers** for menus, popovers and tooltips: flip, shift and fit to the viewport.
|
|
37
|
+
- Typed, and every component is also available on its own, so you can ship only the ones you use
|
|
38
|
+
([measured below](#import-only-what-you-use)).
|
|
39
|
+
|
|
40
|
+
## Install
|
|
2
41
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
[](https://bundlephobia.com/package/@editora/ui-core)
|
|
7
|
-
|
|
8
|
-

|
|
42
|
+
```bash
|
|
43
|
+
npm install @editora/ui-core
|
|
44
|
+
```
|
|
9
45
|
|
|
10
|
-
##
|
|
46
|
+
## Quick start
|
|
11
47
|
|
|
12
|
-
|
|
13
|
-
- **CodeSandboxUI Components:** https://qjr47y-5173.csb.app/button
|
|
14
|
-
- **UI Component Catalog:** https://editora-ecosystem.netlify.app/
|
|
15
|
-
- **Web Demo:** https://editora-free.netlify.app/
|
|
16
|
-
- **Storybook:** https://editora-ecosystem-storybook.netlify.app/
|
|
48
|
+
With a bundler, import the package once to register the elements: `import '@editora/ui-core';`.
|
|
17
49
|
|
|
18
|
-
|
|
50
|
+
With no build step, map the package to a CDN and import it in a module script:
|
|
19
51
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
-
|
|
52
|
+
```html
|
|
53
|
+
<script type="importmap">
|
|
54
|
+
{
|
|
55
|
+
"imports": {
|
|
56
|
+
"@editora/ui-core": "https://cdn.jsdelivr.net/npm/@editora/ui-core/dist/index.esm.js",
|
|
57
|
+
"@editora/icons": "https://cdn.jsdelivr.net/npm/@editora/icons/dist/index.esm.js"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
</script>
|
|
61
|
+
<script type="module">
|
|
62
|
+
import '@editora/ui-core';
|
|
63
|
+
</script>
|
|
25
64
|
|
|
26
|
-
|
|
65
|
+
<ui-field label="Email" description="Work email" required>
|
|
66
|
+
<ui-input name="email" type="email" placeholder="you@company.com" clearable></ui-input>
|
|
67
|
+
</ui-field>
|
|
27
68
|
|
|
28
|
-
|
|
29
|
-
npm install @editora/ui-core
|
|
69
|
+
<ui-button variant="primary">Save</ui-button>
|
|
30
70
|
```
|
|
31
71
|
|
|
32
|
-
|
|
72
|
+
The examples below assume `@editora/ui-core` resolves, through a bundler or the import map above.
|
|
33
73
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
```ts
|
|
37
|
-
import '@editora/ui-core';
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Then use components directly:
|
|
74
|
+
The picture at the top of this page is made of these elements:
|
|
41
75
|
|
|
42
76
|
```html
|
|
43
|
-
<
|
|
44
|
-
<
|
|
45
|
-
|
|
77
|
+
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start">
|
|
78
|
+
<div style="display: grid; gap: 16px">
|
|
79
|
+
<ui-field label="Project name" description="Shown in the sidebar">
|
|
80
|
+
<ui-input placeholder="Untitled" clearable></ui-input>
|
|
81
|
+
</ui-field>
|
|
82
|
+
|
|
83
|
+
<div style="display: flex; gap: 8px; flex-wrap: wrap">
|
|
84
|
+
<ui-button variant="primary">Save</ui-button>
|
|
85
|
+
<ui-button variant="secondary">Cancel</ui-button>
|
|
86
|
+
<ui-button variant="ghost">Skip</ui-button>
|
|
87
|
+
<ui-button variant="danger">Delete</ui-button>
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
<div style="display: flex; gap: 8px; align-items: center">
|
|
91
|
+
<ui-badge tone="success" text="Live"></ui-badge>
|
|
92
|
+
<ui-badge tone="warning" text="Review"></ui-badge>
|
|
93
|
+
<ui-badge tone="danger" text="Failed"></ui-badge>
|
|
94
|
+
<ui-avatar initials="AM" size="md"></ui-avatar>
|
|
95
|
+
<ui-avatar initials="JK" size="md"></ui-avatar>
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
<ui-alert title="Heads up" description="Your trial ends in 3 days." tone="warning"></ui-alert>
|
|
99
|
+
</div>
|
|
100
|
+
|
|
101
|
+
<div style="display: grid; gap: 16px">
|
|
102
|
+
<ui-switch checked label="Email notifications" description="A summary every Monday"></ui-switch>
|
|
103
|
+
<ui-checkbox checked>Remember me</ui-checkbox>
|
|
104
|
+
<ui-progress value="64"></ui-progress>
|
|
105
|
+
<ui-date-picker label="Start date" clearable></ui-date-picker>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
46
108
|
|
|
47
|
-
<
|
|
109
|
+
<script type="module">
|
|
110
|
+
import '@editora/ui-core';
|
|
111
|
+
</script>
|
|
48
112
|
```
|
|
49
113
|
|
|
50
|
-
##
|
|
114
|
+
## Import only what you use
|
|
51
115
|
|
|
52
|
-
|
|
116
|
+
`import '@editora/ui-core'` registers every component. Each component also has its own entry, named after its tag
|
|
117
|
+
without the `ui-` prefix, and registers just that element:
|
|
53
118
|
|
|
54
119
|
```ts
|
|
55
120
|
import '@editora/ui-core/button';
|
|
@@ -57,85 +122,17 @@ import '@editora/ui-core/input';
|
|
|
57
122
|
import '@editora/ui-core/date-picker';
|
|
58
123
|
```
|
|
59
124
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
```ts
|
|
63
|
-
import '@editora/ui-core/sortable';
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
The standalone wrappers live in `src/standalone` and are checked into the package. The build reads from that folder directly, so there is no generator step in the normal build or publish flow.
|
|
67
|
-
|
|
68
|
-
## Framework Direct Usage
|
|
69
|
-
|
|
70
|
-
`@editora/ui-core` can be used directly in Vue, Svelte, and Angular because the package ships standards-based custom elements.
|
|
71
|
-
|
|
72
|
-
- Vue and Svelte work well directly for attribute/event-driven components, and can also handle richer elements like `ui-sortable` through refs.
|
|
73
|
-
- Angular also works directly, but you should add `CUSTOM_ELEMENTS_SCHEMA` and use `@ViewChild` for array or object-valued properties.
|
|
74
|
-
- Production wrappers are optional DX improvements, not a requirement for using `ui-core`.
|
|
75
|
-
|
|
76
|
-
Examples:
|
|
77
|
-
|
|
78
|
-
- Vue direct example: [`examples/ui-core-vue-direct`](https://github.com/ajaykr089/Editora/tree/main/examples/ui-core-vue-direct)
|
|
79
|
-
- Svelte direct example: [`examples/ui-core-svelte-direct`](/https://github.com/ajaykr089/Editora/tree/main/examples/ui-core-svelte-direct)
|
|
80
|
-
- Angular direct example: [`examples/ui-core-angular-direct`](https://github.com/ajaykr089/Editora/tree/main/examples/ui-core-angular-direct)
|
|
81
|
-
|
|
82
|
-
More guidance lives in [`docs/FRAMEWORK_DIRECT_USAGE.md`](https://github.com/ajaykr089/Editora/tree/main/packages/ui-core/docs/FRAMEWORK_DIRECT_USAGE.md).
|
|
125
|
+
Bundle sizes, measured with esbuild (minified ES modules):
|
|
83
126
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
-
|
|
88
|
-
|
|
89
|
-
- `applyTheme`, `defaultTokens`
|
|
90
|
-
- `showPortalFor`, `autoUpdatePosition`, portal helpers
|
|
91
|
-
- `createPositioner`, `computePositionState`, `autoUpdatePositioner`, middleware helpers, virtual anchors
|
|
92
|
-
- focus/overlay managers
|
|
93
|
-
- `showToast`
|
|
94
|
-
|
|
95
|
-
### Dialog managers (Promise API)
|
|
96
|
-
- `createDialogManager`, `DialogManager`
|
|
97
|
-
- `createAlertDialogManager`, `AlertDialogManager`
|
|
98
|
-
|
|
99
|
-
## Component Catalog
|
|
100
|
-
|
|
101
|
-
### Primitives and forms
|
|
102
|
-
- `ui-button`, `ui-split-button`, `ui-input`, `ui-textarea`, `ui-label`, `ui-description`, `ui-field-error`, `ui-control-group`, `ui-fieldset`, `ui-field`, `ui-form`, `ui-pin-input`, `ui-otp-input`, `ui-inline-edit`
|
|
103
|
-
- `ui-checkbox`, `ui-radio`, `ui-radio-group`, `ui-switch`, `ui-slider`, `ui-select`, `ui-combobox`
|
|
104
|
-
- `ui-date-picker`, `ui-date-range-picker`, `ui-time-picker`, `ui-date-time-picker`, `ui-date-range-time-picker`
|
|
105
|
-
- `ui-color-picker`
|
|
106
|
-
|
|
107
|
-
### Navigation and layout
|
|
108
|
-
- `ui-layout`, `ui-sidebar`, `ui-app-header`, `ui-breadcrumb`, `ui-navigation-menu`, `ui-menubar`, `ui-tabs`
|
|
109
|
-
- `ui-box`, `ui-flex`, `ui-grid`, `ui-section`, `ui-container`
|
|
110
|
-
- `ui-drawer`
|
|
111
|
-
|
|
112
|
-
### Overlays and interactions
|
|
113
|
-
- `ui-dialog`, `ui-alert-dialog`, `ui-popover`, `ui-dropdown`, `ui-menu`, `ui-context-menu`, `ui-tooltip`, `ui-hover-card`
|
|
114
|
-
- `ui-command`, `ui-command-palette`, `ui-quick-actions`, `ui-selection-popup`, `ui-plugin-panel`, `ui-floating-toolbar`, `ui-toolbar`
|
|
115
|
-
- `ui-portal`, `ui-presence`, `ui-slot`, `ui-visually-hidden`
|
|
116
|
-
|
|
117
|
-
### Data and display
|
|
118
|
-
- `ui-table`, `ui-data-table`, `ui-pagination`, `ui-empty-state`, `ui-skeleton`, `ui-alert`, `ui-badge`, `ui-transfer-list`
|
|
119
|
-
- `ui-chart`, `ui-timeline`, `ui-gantt`, `ui-calendar`, `ui-progress`, `ui-scroll-area`, `ui-separator`
|
|
120
|
-
- `ui-accordion`, `ui-collapsible`, `ui-stepper`, `ui-wizard`, `ui-avatar`, `ui-aspect-ratio`, `ui-block-controls`, `ui-icon`
|
|
121
|
-
|
|
122
|
-
## Usage Patterns
|
|
123
|
-
|
|
124
|
-
### 1. Attributes + events
|
|
125
|
-
|
|
126
|
-
```html
|
|
127
|
-
<ui-date-picker id="start" name="startDate" clearable></ui-date-picker>
|
|
128
|
-
<script type="module">
|
|
129
|
-
import '@editora/ui-core';
|
|
127
|
+
| Import | Size |
|
|
128
|
+
| --- | --- |
|
|
129
|
+
| `@editora/ui-core` (everything) | 2.4 MB (493 KB gzipped) |
|
|
130
|
+
| `@editora/ui-core/button` | 165 KB (54 KB gzipped) |
|
|
131
|
+
| `button`, `input` and `date-picker` together | 296 KB (85 KB gzipped) |
|
|
130
132
|
|
|
131
|
-
|
|
132
|
-
picker.addEventListener('change', (e) => {
|
|
133
|
-
console.log('new date', e.detail.value);
|
|
134
|
-
});
|
|
135
|
-
</script>
|
|
136
|
-
```
|
|
133
|
+
## Forms
|
|
137
134
|
|
|
138
|
-
|
|
135
|
+
`<ui-form>` finds the `name`d controls inside it, so you do not wire up each field:
|
|
139
136
|
|
|
140
137
|
```html
|
|
141
138
|
<ui-form id="profileForm" autosave guard-unsaved>
|
|
@@ -158,10 +155,26 @@ More guidance lives in [`docs/FRAMEWORK_DIRECT_USAGE.md`](https://github.com/aja
|
|
|
158
155
|
</script>
|
|
159
156
|
```
|
|
160
157
|
|
|
161
|
-
|
|
158
|
+
<p align="center">
|
|
159
|
+
<img src="https://raw.githubusercontent.com/ajaykr089/Editora/main/packages/ui-core/docs/images/form.png" alt="The form after pressing Save with both required fields empty: each field is outlined in red with the message Please fill out this field." width="900">
|
|
160
|
+
</p>
|
|
161
|
+
|
|
162
|
+
| Event | `event.detail` |
|
|
163
|
+
| --- | --- |
|
|
164
|
+
| `submit` | `{ values }`: fired when the form is valid. |
|
|
165
|
+
| `invalid` | `{ errors }`: the error message of each invalid field. |
|
|
166
|
+
| `dirty-change` | `{ dirty }`: whether the values differ from the starting values. |
|
|
167
|
+
| `autosave` | `{ values, dirty }`: with the `autosave` attribute, fired once the values have stopped changing for `autosave-delay` milliseconds (800 by default) and differ from the starting values. Save your draft in the handler. |
|
|
168
|
+
|
|
169
|
+
A button with `type="submit"` or `type="reset"` inside the form submits or resets it. The form also has `submit()`,
|
|
170
|
+
`validate()`, `getValues()` and `reset()` methods. `guard-unsaved` warns before the page is left with unsaved changes.
|
|
171
|
+
|
|
172
|
+
## Data tables
|
|
173
|
+
|
|
174
|
+
A table in `<ui-data-table>` gets sorting, selection and paging; a `<ui-pagination>` with a matching id is the pager:
|
|
162
175
|
|
|
163
176
|
```html
|
|
164
|
-
<ui-data-table id="usersTable" sortable selectable page-size="
|
|
177
|
+
<ui-data-table id="usersTable" sortable selectable page-size="2" pagination-id="usersPager">
|
|
165
178
|
<table>
|
|
166
179
|
<thead>
|
|
167
180
|
<tr>
|
|
@@ -173,16 +186,29 @@ More guidance lives in [`docs/FRAMEWORK_DIRECT_USAGE.md`](https://github.com/aja
|
|
|
173
186
|
<tbody>
|
|
174
187
|
<tr><td>1</td><td>Asha</td><td>Admin</td></tr>
|
|
175
188
|
<tr><td>2</td><td>Marco</td><td>Editor</td></tr>
|
|
189
|
+
<tr><td>3</td><td>Lena</td><td>Viewer</td></tr>
|
|
190
|
+
<tr><td>4</td><td>Tariq</td><td>Editor</td></tr>
|
|
176
191
|
</tbody>
|
|
177
192
|
</table>
|
|
178
193
|
</ui-data-table>
|
|
179
194
|
|
|
180
195
|
<ui-pagination id="usersPager"></ui-pagination>
|
|
196
|
+
|
|
197
|
+
<script type="module">
|
|
198
|
+
import '@editora/ui-core';
|
|
199
|
+
</script>
|
|
181
200
|
```
|
|
182
201
|
|
|
183
|
-
|
|
202
|
+
<p align="center">
|
|
203
|
+
<img src="https://raw.githubusercontent.com/ajaykr089/Editora/main/packages/ui-core/docs/images/data-table.png" alt="A table with sortable ID, Name and Role columns showing two rows, and a pager that reads Showing 1-2 of 4" width="900">
|
|
204
|
+
</p>
|
|
205
|
+
|
|
206
|
+
For long tables, `virtualize` renders only the rows that are on screen.
|
|
184
207
|
|
|
185
|
-
|
|
208
|
+
## Gantt chart
|
|
209
|
+
|
|
210
|
+
`<ui-gantt>` is a planning timeline: tasks, summary rows and milestones, dependencies, baselines, critical tasks, drag
|
|
211
|
+
and resize, and a toolbar for zoom, filter and sort. Give it `tasks` and `links` as JSON:
|
|
186
212
|
|
|
187
213
|
```html
|
|
188
214
|
<ui-gantt id="releasePlan" zoom="week" sort="start" bar-variant="soft"></ui-gantt>
|
|
@@ -222,138 +248,183 @@ More guidance lives in [`docs/FRAMEWORK_DIRECT_USAGE.md`](https://github.com/aja
|
|
|
222
248
|
</script>
|
|
223
249
|
```
|
|
224
250
|
|
|
225
|
-
|
|
251
|
+
<p align="center">
|
|
252
|
+
<img src="https://raw.githubusercontent.com/ajaykr089/Editora/main/packages/ui-core/docs/images/gantt.png" alt="A Gantt chart with a task bar for API contracts, a baseline under it, and an arrow to the QA sign-off milestone" width="900">
|
|
253
|
+
</p>
|
|
226
254
|
|
|
227
|
-
- `zoom`: `day`, `week`, `month`, `quarter
|
|
228
|
-
- `
|
|
229
|
-
-
|
|
230
|
-
- `readonly`, `show-toolbar`, `show-today`, `filter`, `virtualized="false"`
|
|
255
|
+
- `zoom`: `day`, `week`, `month`, `quarter` or `year`. `sort`: `none`, `start`, `end`, `label` or `progress`.
|
|
256
|
+
- `bar-variant`: `solid`, `soft`, `striped`, `outline` or `glass`.
|
|
257
|
+
- Dependency types: `e2s`, `s2s`, `e2e` and `s2e`.
|
|
258
|
+
- Also: `readonly`, `show-toolbar`, `show-today`, `filter`, and `virtualized="false"` for small layouts (large task sets are
|
|
259
|
+
virtualized automatically).
|
|
231
260
|
|
|
232
|
-
|
|
261
|
+
## Promise dialogs
|
|
233
262
|
|
|
234
|
-
|
|
235
|
-
import '@editora/ui-core';
|
|
236
|
-
import { createDialogManager } from '@editora/ui-core';
|
|
237
|
-
|
|
238
|
-
const dialogs = createDialogManager();
|
|
239
|
-
|
|
240
|
-
const result = await dialogs.confirm({
|
|
241
|
-
title: 'Delete record',
|
|
242
|
-
description: 'This action cannot be undone.',
|
|
243
|
-
submitText: 'Delete',
|
|
244
|
-
cancelText: 'Cancel',
|
|
245
|
-
mode: 'queue'
|
|
246
|
-
});
|
|
247
|
-
|
|
248
|
-
if (result.action === 'submit') {
|
|
249
|
-
// perform delete
|
|
250
|
-
}
|
|
251
|
-
```
|
|
263
|
+
The dialog managers open a dialog and give you a promise for the answer:
|
|
252
264
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
import { createAlertDialogManager } from '@editora/ui-core';
|
|
265
|
+
```html
|
|
266
|
+
<ui-button id="remove" variant="danger">Delete record</ui-button>
|
|
267
|
+
<ui-button id="publish" variant="secondary">Publish</ui-button>
|
|
268
|
+
<pre id="result"></pre>
|
|
258
269
|
|
|
259
|
-
|
|
270
|
+
<script type="module">
|
|
271
|
+
import { createAlertDialogManager, createDialogManager } from '@editora/ui-core';
|
|
272
|
+
|
|
273
|
+
const dialogs = createDialogManager();
|
|
274
|
+
const alerts = createAlertDialogManager();
|
|
275
|
+
const result = document.getElementById('result');
|
|
276
|
+
|
|
277
|
+
document.getElementById('remove').onclick = async () => {
|
|
278
|
+
const answer = await dialogs.confirm({
|
|
279
|
+
title: 'Delete record',
|
|
280
|
+
description: 'This action cannot be undone.',
|
|
281
|
+
submitText: 'Delete',
|
|
282
|
+
cancelText: 'Cancel',
|
|
283
|
+
mode: 'queue'
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
result.textContent = answer.action === 'submit' ? 'Deleted' : 'Kept';
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
document.getElementById('publish').onclick = async () => {
|
|
290
|
+
const answer = await alerts.confirm({
|
|
291
|
+
title: 'Publish changes?',
|
|
292
|
+
description: 'You can still unpublish later.',
|
|
293
|
+
confirmText: 'Publish',
|
|
294
|
+
cancelText: 'Not now'
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
result.textContent = answer.action === 'confirm' ? 'Published' : 'Not published';
|
|
298
|
+
};
|
|
299
|
+
</script>
|
|
300
|
+
```
|
|
260
301
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
confirmText: 'Publish',
|
|
265
|
-
cancelText: 'Not now'
|
|
266
|
-
});
|
|
302
|
+
<p align="center">
|
|
303
|
+
<img src="https://raw.githubusercontent.com/ajaykr089/Editora/main/packages/ui-core/docs/images/dialog.png" alt="A confirm dialog titled Delete record with the text This action cannot be undone, and Cancel and Delete buttons, over a dimmed page" width="700">
|
|
304
|
+
</p>
|
|
267
305
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
}
|
|
271
|
-
```
|
|
306
|
+
`createDialogManager()` is for general dialogs and `createAlertDialogManager()` for confirmations that need an answer.
|
|
307
|
+
Call `destroy()` on a manager when your app shuts down, not right after opening a dialog.
|
|
272
308
|
|
|
273
309
|
## Theming
|
|
274
310
|
|
|
275
|
-
|
|
311
|
+
`applyTheme` writes the design tokens as CSS variables on the page, or on one element if you pass it as the second
|
|
312
|
+
argument:
|
|
276
313
|
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
314
|
+
```html
|
|
315
|
+
<ui-button variant="primary">Save</ui-button>
|
|
316
|
+
<ui-badge tone="success" text="Live"></ui-badge>
|
|
317
|
+
|
|
318
|
+
<script type="module">
|
|
319
|
+
import { applyTheme, defaultTokens } from '@editora/ui-core';
|
|
320
|
+
|
|
321
|
+
applyTheme({
|
|
322
|
+
...defaultTokens,
|
|
323
|
+
colors: {
|
|
324
|
+
...defaultTokens.colors,
|
|
325
|
+
primary: '#0f766e',
|
|
326
|
+
text: '#0f172a',
|
|
327
|
+
background: '#ffffff'
|
|
328
|
+
},
|
|
329
|
+
radius: '10px'
|
|
330
|
+
});
|
|
331
|
+
</script>
|
|
290
332
|
```
|
|
291
333
|
|
|
292
|
-
|
|
334
|
+
Apply the theme early, before the first render. To theme one part of the page, call
|
|
335
|
+
`applyTheme(tokens, element)`.
|
|
293
336
|
|
|
294
|
-
|
|
337
|
+
## Floating positioning
|
|
295
338
|
|
|
296
|
-
|
|
339
|
+
The positioning engine behind the menus, popovers and tooltips is available on its own, from
|
|
340
|
+
`@editora/ui-core/runtime`:
|
|
297
341
|
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
342
|
+
```html
|
|
343
|
+
<ui-button id="trigger" variant="secondary">Open</ui-button>
|
|
344
|
+
<div id="panel" style="padding: 12px 16px; border: 1px solid #cbd5e1; border-radius: 8px; background: white; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);">
|
|
345
|
+
A panel that stays next to its button.
|
|
346
|
+
</div>
|
|
347
|
+
|
|
348
|
+
<script type="module">
|
|
349
|
+
import { createPositioner } from '@editora/ui-core/runtime';
|
|
350
|
+
|
|
351
|
+
const trigger = document.getElementById('trigger');
|
|
352
|
+
const panel = document.getElementById('panel');
|
|
353
|
+
|
|
354
|
+
const handle = createPositioner({
|
|
355
|
+
anchor: trigger,
|
|
356
|
+
floating: panel,
|
|
357
|
+
placement: 'bottom-start',
|
|
358
|
+
strategy: 'fixed',
|
|
359
|
+
offset: 8,
|
|
360
|
+
flip: true,
|
|
361
|
+
shift: true,
|
|
362
|
+
fitViewport: true
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
// later: handle.destroy();
|
|
366
|
+
</script>
|
|
314
367
|
```
|
|
315
368
|
|
|
316
|
-
|
|
369
|
+
Also exported: `computePositionState()` for one-off coordinates, `autoUpdatePositioner()` for observer-driven updates,
|
|
370
|
+
`createVirtualPoint()`, `createVirtualRect()` and `createVirtualRange()` for virtual anchors, and
|
|
371
|
+
`detectPositionerOverflow()` for diagnostics. See the
|
|
372
|
+
[floating guide](https://github.com/ajaykr089/Editora/blob/main/packages/ui-core/docs/FLOATING_USAGE.md).
|
|
317
373
|
|
|
318
|
-
|
|
319
|
-
- `autoUpdatePositioner()` for observer-driven updates
|
|
320
|
-
- `createVirtualPoint()`, `createVirtualRect()`, `createVirtualRange()` for virtual anchors
|
|
321
|
-
- `detectPositionerOverflow()` for diagnostics and custom middleware
|
|
374
|
+
## Components
|
|
322
375
|
|
|
323
|
-
|
|
376
|
+
Each component is a custom element named `ui-*`; the standalone entry is the name without the prefix.
|
|
324
377
|
|
|
325
|
-
|
|
378
|
+
**Forms and inputs:**
|
|
379
|
+
`ui-button`, `ui-split-button`, `ui-input`, `ui-textarea`, `ui-label`, `ui-description`, `ui-field-error`, `ui-control-group`, `ui-fieldset`, `ui-field`, `ui-form`,
|
|
380
|
+
`ui-checkbox`, `ui-radio`, `ui-radio-group`, `ui-switch`, `ui-slider`, `ui-select`, `ui-combobox`,
|
|
381
|
+
`ui-date-picker`, `ui-date-range-picker`, `ui-time-picker`, `ui-date-time-picker`, `ui-date-range-time-picker`, `ui-color-picker`
|
|
326
382
|
|
|
327
|
-
|
|
383
|
+
**Navigation and layout:**
|
|
384
|
+
`ui-layout`, `ui-sidebar`, `ui-app-header`, `ui-breadcrumb`, `ui-navigation-menu`, `ui-menubar`, `ui-tabs`, `ui-drawer`,
|
|
385
|
+
`ui-box`, `ui-flex`, `ui-grid`, `ui-section`, `ui-container`
|
|
328
386
|
|
|
329
|
-
|
|
330
|
-
- `
|
|
331
|
-
- `
|
|
332
|
-
- `
|
|
333
|
-
- `docs/PRIMITIVE_IMPLEMENTATION_PLAN.md` for proposed APIs and rollout order
|
|
387
|
+
**Overlays and interaction:**
|
|
388
|
+
`ui-dialog`, `ui-alert-dialog`, `ui-popover`, `ui-dropdown`, `ui-menu`, `ui-context-menu`, `ui-tooltip`, `ui-hover-card`,
|
|
389
|
+
`ui-command`, `ui-command-palette`, `ui-quick-actions`, `ui-selection-popup`, `ui-plugin-panel`, `ui-floating-toolbar`, `ui-toolbar`,
|
|
390
|
+
`ui-portal`, `ui-presence`, `ui-slot`, `ui-visually-hidden`
|
|
334
391
|
|
|
335
|
-
|
|
392
|
+
**Data and display:**
|
|
393
|
+
`ui-table`, `ui-data-table`, `ui-pagination`, `ui-empty-state`, `ui-skeleton`, `ui-alert`, `ui-badge`, `ui-transfer-list`,
|
|
394
|
+
`ui-chart`, `ui-timeline`, `ui-gantt`, `ui-calendar`, `ui-progress`, `ui-scroll-area`, `ui-separator`,
|
|
395
|
+
`ui-accordion`, `ui-collapsible`, `ui-stepper`, `ui-wizard`, `ui-avatar`, `ui-aspect-ratio`, `ui-block-controls`, `ui-icon`
|
|
336
396
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
- Events are dispatched as `CustomEvent` with `detail`, usually `bubbles: true` and `composed: true`.
|
|
340
|
-
- For best performance, keep long tables virtualized (`ui-data-table[virtualize]`) and avoid unnecessary DOM churn in cell renderers.
|
|
397
|
+
Besides these, the package exports `createSignal`, `computed` and `effect` (small reactive primitives), `ElementBase` (the
|
|
398
|
+
base class of the components), the portal, focus and overlay managers, and `showToast`.
|
|
341
399
|
|
|
342
|
-
##
|
|
400
|
+
## Other frameworks
|
|
343
401
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
402
|
+
The elements are standard custom elements, so Vue, Svelte and Angular can use them directly. Vue and Svelte work well
|
|
403
|
+
with attributes and events; in Angular, add `CUSTOM_ELEMENTS_SCHEMA` and use `@ViewChild` for array and object values.
|
|
404
|
+
Working examples:
|
|
405
|
+
[Vue](https://github.com/ajaykr089/Editora/tree/main/examples/ui-core-vue-direct),
|
|
406
|
+
[Svelte](https://github.com/ajaykr089/Editora/tree/main/examples/ui-core-svelte-direct) and
|
|
407
|
+
[Angular](https://github.com/ajaykr089/Editora/tree/main/examples/ui-core-angular-direct), and the
|
|
408
|
+
[guide](https://github.com/ajaykr089/Editora/blob/main/packages/ui-core/docs/FRAMEWORK_DIRECT_USAGE.md). For React,
|
|
409
|
+
use [`@editora/ui-react`](https://www.npmjs.com/package/@editora/ui-react).
|
|
410
|
+
|
|
411
|
+
## Good to know
|
|
412
|
+
|
|
413
|
+
- Components register when their module is imported, so the package is marked `sideEffects: true`. Import it before the
|
|
414
|
+
first render.
|
|
415
|
+
- Events are `CustomEvent`s with a `detail`; they usually bubble and cross shadow boundaries.
|
|
416
|
+
- If a component renders as an empty tag, `@editora/ui-core` (or its standalone entry) was not imported before it.
|
|
417
|
+
- If the styles look unthemed, apply the tokens early with `applyTheme(...)`.
|
|
418
|
+
|
|
419
|
+
## The rest of the family
|
|
349
420
|
|
|
350
|
-
|
|
421
|
+
| Package | |
|
|
422
|
+
| --- | --- |
|
|
423
|
+
| [`@editora/ui-react`](https://www.npmjs.com/package/@editora/ui-react) | These components as React components. |
|
|
424
|
+
| [`@editora/ui-sortable`](https://www.npmjs.com/package/@editora/ui-sortable) | Sortable lists and boards. |
|
|
425
|
+
| [`@editora/icons`](https://www.npmjs.com/package/@editora/icons) | The icon set the components use. |
|
|
426
|
+
| [`@editora/toast`](https://www.npmjs.com/package/@editora/toast) | Toast notifications. |
|
|
351
427
|
|
|
352
|
-
##
|
|
428
|
+
## License
|
|
353
429
|
|
|
354
|
-
|
|
355
|
-
- Ensure `@editora/ui-core` is imported before first render.
|
|
356
|
-
- Styles look unthemed:
|
|
357
|
-
- Apply tokens early in bootstrap with `applyTheme(...)`.
|
|
358
|
-
- Dialog promises never resolving:
|
|
359
|
-
- Ensure you call `destroy()` on manager during app teardown only, not immediately after open.
|
|
430
|
+
MIT © [Ajay Kumar](https://github.com/ajaykr089)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { D as s } from "./domElement-ZlSGVP0l.mjs";
|
|
2
|
+
class d extends s {
|
|
2
3
|
constructor() {
|
|
3
4
|
super(), this._isRendering = !1, this._renderRequested = !1, this._renderScheduled = !1, this._hasRendered = !1, this._visibilityGuardApplied = !1, this._lastRenderedContent = null, this.root = this.attachShadow({ mode: "open" });
|
|
4
5
|
}
|
|
@@ -75,5 +76,5 @@ class n extends HTMLElement {
|
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
export {
|
|
78
|
-
|
|
79
|
+
d as E
|
|
79
80
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("./domElement-DazSZBjV.js");class n extends s.DOMElement{constructor(){super(),this._isRendering=!1,this._renderRequested=!1,this._renderScheduled=!1,this._hasRendered=!1,this._visibilityGuardApplied=!1,this._lastRenderedContent=null,this.root=this.attachShadow({mode:"open"})}connectedCallback(){if(!this._hasRendered&&!this._visibilityGuardApplied&&(this.style.getPropertyValue("visibility").trim()||(this.style.setProperty("visibility","hidden"),this._visibilityGuardApplied=!0)),!this._hasRendered){this._requestRender();return}this._scheduleRender()}disconnectedCallback(){try{if(typeof this.close=="function")try{this.close()}catch{}if(typeof this._cleanup=="function"){try{this._cleanup()}catch{}this._cleanup=void 0}if(typeof this.__menuCleanup=="function"){try{this.__menuCleanup()}catch{}this.__menuCleanup=null}const e=this._portalEl;if(e&&e.parentElement)try{e.parentElement.removeChild(e)}catch{}}catch{}}attributeChangedCallback(e,t,i){t!==i&&this.isConnected&&(e&&!this.shouldRenderOnAttributeChange(e,t??null,i??null)||this._scheduleRender())}shouldRenderOnAttributeChange(e,t,i){return!0}setContent(e,t){!t?.force&&this._lastRenderedContent===e||(this.root.innerHTML=e,this._lastRenderedContent=e)}invalidateContentCache(){this._lastRenderedContent=null}requestRender(){this._scheduleRender()}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this._requestRender()}))}_requestRender(){if(this._isRendering){this._renderRequested=!0;return}this._isRendering=!0;try{this.render()}finally{this._isRendering=!1,this._hasRendered||(this._hasRendered=!0,this._visibilityGuardApplied&&(this.style.removeProperty("visibility"),this._visibilityGuardApplied=!1))}this._renderRequested&&(this._renderRequested=!1,this._scheduleRender())}}exports.ElementBase=n;
|
package/dist/ElementBase.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementBase.d.ts","sourceRoot":"","sources":["../src/ElementBase.ts"],"names":[],"mappings":"AAAA,8BAAsB,WAAY,SAAQ,
|
|
1
|
+
{"version":3,"file":"ElementBase.d.ts","sourceRoot":"","sources":["../src/ElementBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,8BAAsB,WAAY,SAAQ,UAAU;IAClD,SAAS,CAAC,IAAI,EAAE,UAAU,CAAC;IAC3B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,uBAAuB,CAAS;IACxC,OAAO,CAAC,oBAAoB,CAAuB;;IAOnD,iBAAiB;IAejB,oBAAoB;IA2BpB,wBAAwB,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI;IAS1F,SAAS,CAAC,6BAA6B,CACrC,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,SAAS,EAAE,MAAM,GAAG,IAAI,GACvB,OAAO;IAIV,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;IAOhE,SAAS,CAAC,sBAAsB,IAAI,IAAI;IAIxC,SAAS,CAAC,aAAa,IAAI,IAAI;IAI/B,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,cAAc;IAwBtB,SAAS,CAAC,QAAQ,CAAC,MAAM,IAAI,IAAI;CAClC"}
|