@cscfi/csc-ui 4.0.0-alpha.22 → 4.0.0-alpha.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/csc-ui.js +6008 -5891
- package/dist/custom-elements.json +1 -1
- package/dist/docs/c-main/usage.md +2 -2
- package/dist/floating-ui.dom-DvzxEaDJ.js +1292 -0
- package/dist/vscode.css-custom-data.json +1 -1
- package/dist/vscode.html-custom-data.json +1 -1
- package/dist/web-types.json +3 -3
- package/dist-types/components/c-main/CMain.vue.d.ts +1 -0
- package/dist-types/shared/useAnchoredPanel.d.ts +4 -3
- package/dist-types/shared/useDesignatedTrigger.d.ts +5 -4
- package/dist-types/shared/useFallbackPosition.d.ts +58 -0
- package/package.json +2 -2
- package/dist/css-anchor-positioning-fn-RTxo68pt.js +0 -6447
- package/dist-types/shared/anchorPolyfill.d.ts +0 -24
|
@@ -374,7 +374,7 @@
|
|
|
374
374
|
},
|
|
375
375
|
{
|
|
376
376
|
"name": "::part(root)",
|
|
377
|
-
"description": "The
|
|
377
|
+
"description": "The shell box: it paints the page canvas and is at least a viewport tall; the dashboard grid is laid out inside it"
|
|
378
378
|
},
|
|
379
379
|
{
|
|
380
380
|
"name": "::part(trigger)",
|
|
@@ -937,7 +937,7 @@
|
|
|
937
937
|
},
|
|
938
938
|
{
|
|
939
939
|
"name": "c-main",
|
|
940
|
-
"description": "The page shell of an application: it paints the page canvas and lays out the toolbar, the side navigation and the page in the dashboard layout. It is at least a viewport tall and grows with its content, so the document — not a component — is what scrolls.\n---\n\n\n### **Slots:**\n - **default** - Contents of the page: the toolbar, side navigation and page\n- **banner** - A full-width message strip above the toolbar; it scrolls away with the page\n\n### **CSS Properties:**\n - **--c-main-viewport-height** - Height of the scroll viewport the layout pins against (default `100dvh`); a bounded shell with its own scrollbar sets it to its box height _(default: undefined)_\n\n### **CSS Parts:**\n - **root** - The
|
|
940
|
+
"description": "The page shell of an application: it paints the page canvas and lays out the toolbar, the side navigation and the page in the dashboard layout. It is at least a viewport tall and grows with its content, so the document — not a component — is what scrolls.\n---\n\n\n### **Slots:**\n - **default** - Contents of the page: the toolbar, side navigation and page\n- **banner** - A full-width message strip above the toolbar; it scrolls away with the page\n\n### **CSS Properties:**\n - **--c-main-viewport-height** - Height of the scroll viewport the layout pins against (default `100dvh`); a bounded shell with its own scrollbar sets it to its box height _(default: undefined)_\n\n### **CSS Parts:**\n - **root** - The shell box: it paints the page canvas and is at least a viewport tall; the dashboard grid is laid out inside it",
|
|
941
941
|
"attributes": [
|
|
942
942
|
{
|
|
943
943
|
"name": "disable-layout",
|
package/dist/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "@cscfi/csc-ui",
|
|
4
|
-
"version": "4.0.0-alpha.
|
|
4
|
+
"version": "4.0.0-alpha.24",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -2456,7 +2456,7 @@
|
|
|
2456
2456
|
},
|
|
2457
2457
|
{
|
|
2458
2458
|
"name": "c-main",
|
|
2459
|
-
"description": "The page shell of an application: it paints the page canvas and lays out the toolbar, the side navigation and the page in the dashboard layout. It is at least a viewport tall and grows with its content, so the document — not a component — is what scrolls.\n---\n\n\n### **Slots:**\n - **default** - Contents of the page: the toolbar, side navigation and page\n- **banner** - A full-width message strip above the toolbar; it scrolls away with the page\n\n### **CSS Properties:**\n - **--c-main-viewport-height** - Height of the scroll viewport the layout pins against (default `100dvh`); a bounded shell with its own scrollbar sets it to its box height _(default: undefined)_\n\n### **CSS Parts:**\n - **root** - The
|
|
2459
|
+
"description": "The page shell of an application: it paints the page canvas and lays out the toolbar, the side navigation and the page in the dashboard layout. It is at least a viewport tall and grows with its content, so the document — not a component — is what scrolls.\n---\n\n\n### **Slots:**\n - **default** - Contents of the page: the toolbar, side navigation and page\n- **banner** - A full-width message strip above the toolbar; it scrolls away with the page\n\n### **CSS Properties:**\n - **--c-main-viewport-height** - Height of the scroll viewport the layout pins against (default `100dvh`); a bounded shell with its own scrollbar sets it to its box height _(default: undefined)_\n\n### **CSS Parts:**\n - **root** - The shell box: it paints the page canvas and is at least a viewport tall; the dashboard grid is laid out inside it",
|
|
2460
2460
|
"doc-url": "",
|
|
2461
2461
|
"attributes": [
|
|
2462
2462
|
{
|
|
@@ -6230,7 +6230,7 @@
|
|
|
6230
6230
|
},
|
|
6231
6231
|
{
|
|
6232
6232
|
"name": "part(root)",
|
|
6233
|
-
"description": "The
|
|
6233
|
+
"description": "The shell box: it paints the page canvas and is at least a viewport tall; the dashboard grid is laid out inside it"
|
|
6234
6234
|
},
|
|
6235
6235
|
{
|
|
6236
6236
|
"name": "part(trigger)",
|
|
@@ -38,7 +38,8 @@
|
|
|
38
38
|
* release both outside the host close the panel; a press alone — the
|
|
39
39
|
* start of every touch scroll — never does (`lightDismiss.ts`);
|
|
40
40
|
* - focus return to the value field on `close(true)`;
|
|
41
|
-
* - the
|
|
41
|
+
* - the Floating UI placement on an anchored open without native anchor
|
|
42
|
+
* positioning (Firefox 140 ESR; ADR-0056).
|
|
42
43
|
*
|
|
43
44
|
* What stays in the consumer: the `@position-try --c-field-panel-above` /
|
|
44
45
|
* `--c-field-panel-above-left` flip rules and `position-try-fallbacks` —
|
|
@@ -84,11 +85,11 @@ export interface UseAnchoredPanelOptions {
|
|
|
84
85
|
field: Readonly<Ref<HTMLElement | null>>;
|
|
85
86
|
/** Open as a fullscreen panel while true — the shared narrow-viewport predicate (`useNarrowViewport`). Absent: always anchored. */
|
|
86
87
|
fullscreen?: Readonly<Ref<boolean>>;
|
|
87
|
-
/** The custom element host: light dismiss keeps gestures whose composed path includes it;
|
|
88
|
+
/** The custom element host: light dismiss keeps gestures whose composed path includes it; it is what the page lock keeps interactive. */
|
|
88
89
|
host: HTMLElement | null;
|
|
89
90
|
/** Runs inside the native `toggle` handler once closed, before focus returns. */
|
|
90
91
|
onClosed?: () => void;
|
|
91
|
-
/** Runs inside the native `toggle` handler once open, after the
|
|
92
|
+
/** Runs inside the native `toggle` handler once open, after the fallback positioning / page lock and the dismiss listener — the consumer's open sequence goes here. */
|
|
92
93
|
onOpened?: () => void;
|
|
93
94
|
/** The `popover="manual"` panel element. */
|
|
94
95
|
panel: Readonly<Ref<HTMLElement | null>>;
|
|
@@ -10,10 +10,11 @@
|
|
|
10
10
|
* cannot reference an `anchor-name` on an outer-tree element. Instead the
|
|
11
11
|
* component keeps a *proxy anchor* — an inert, fixed-position box in its own
|
|
12
12
|
* shadow root carrying the anchor name — and this composable pins it over
|
|
13
|
-
* the designated trigger's rect while the panel is open (a rAF loop
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
13
|
+
* the designated trigger's rect while the panel is open (a rAF loop).
|
|
14
|
+
* `position-area` placement and the `position-try-fallbacks` flip/shift keep
|
|
15
|
+
* working unchanged; only the measurement is JS. Without native anchor
|
|
16
|
+
* positioning the proxy is unused: Floating UI places the panel against the
|
|
17
|
+
* designated element directly (`useFallbackPosition`, ADR-0056).
|
|
17
18
|
*/
|
|
18
19
|
import { type Ref } from 'vue';
|
|
19
20
|
export interface DesignatedTriggerHandle {
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anchored-panel positioning for browsers without CSS anchor positioning
|
|
3
|
+
* (Firefox 140 ESR; ADR-0056).
|
|
4
|
+
*
|
|
5
|
+
* The overlay components place their top-layer panels with native CSS anchor
|
|
6
|
+
* positioning — `anchor-name` / `position-anchor` / `position-area` plus a
|
|
7
|
+
* `position-try-fallbacks` chain. A browser without the feature drops those
|
|
8
|
+
* declarations, so this composable computes the same placement with
|
|
9
|
+
* `@floating-ui/dom` instead: the preferred placement, then the component's
|
|
10
|
+
* fallback chain in the native order (first one that fits wins, the preferred
|
|
11
|
+
* one when none fits), the gap as an offset. The result is a style string the
|
|
12
|
+
* component appends to its panel style — never written to `el.style` directly,
|
|
13
|
+
* which Vue's next `:style` patch would wipe.
|
|
14
|
+
*
|
|
15
|
+
* On a browser with native support every method is a no-op and `style` stays
|
|
16
|
+
* empty, so the native path is untouched. Floating UI is imported lazily, and
|
|
17
|
+
* preloaded at setup where it will be needed so the first open does not wait
|
|
18
|
+
* on it.
|
|
19
|
+
*
|
|
20
|
+
* Each consumer's `fallbacks` mirror its `position-try-fallbacks` rule; keep
|
|
21
|
+
* the two in step.
|
|
22
|
+
*/
|
|
23
|
+
import { type Ref } from 'vue';
|
|
24
|
+
import type { CPlacement } from '../types';
|
|
25
|
+
type Side = 'bottom' | 'left' | 'right' | 'top';
|
|
26
|
+
/** True when the browser positions anchors without this fallback. */
|
|
27
|
+
export declare const supportsAnchorPositioning: () => boolean;
|
|
28
|
+
/** The `flip-block` try-tactic: mirror across the block axis. */
|
|
29
|
+
export declare const flipBlock: (placement: CPlacement) => CPlacement;
|
|
30
|
+
/** The `flip-inline` try-tactic: mirror across the inline axis. */
|
|
31
|
+
export declare const flipInline: (placement: CPlacement) => CPlacement;
|
|
32
|
+
/**
|
|
33
|
+
* `position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline`
|
|
34
|
+
* — the chain of `c-menu`, `c-tooltip` and `c-popover` — from `placement`.
|
|
35
|
+
*/
|
|
36
|
+
export declare const flipChain: (placement: CPlacement) => CPlacement[];
|
|
37
|
+
export interface FallbackPosition {
|
|
38
|
+
/** Start positioning — call once the panel is open. */
|
|
39
|
+
start(): void;
|
|
40
|
+
/** Stop tracking — call when the panel closes. */
|
|
41
|
+
stop(): void;
|
|
42
|
+
/** Declarations to append to the panel's inline style; empty with native support. */
|
|
43
|
+
style: Readonly<Ref<string>>;
|
|
44
|
+
}
|
|
45
|
+
export interface UseFallbackPositionOptions {
|
|
46
|
+
/** Ordered fallback placements, mirroring the panel's `position-try-fallbacks`. */
|
|
47
|
+
fallbacks: (placement: CPlacement) => CPlacement[];
|
|
48
|
+
/** The `popover` panel. */
|
|
49
|
+
floating: Readonly<Ref<HTMLElement | null>>;
|
|
50
|
+
/** The trigger→panel gap in px on the resolved placement's side (negative pulls the panel in). */
|
|
51
|
+
gap: (side: Side) => number;
|
|
52
|
+
/** The preferred placement (the inline `position-area`). */
|
|
53
|
+
placement: () => CPlacement;
|
|
54
|
+
/** The element the panel sits against. */
|
|
55
|
+
reference: () => Element | null | undefined;
|
|
56
|
+
}
|
|
57
|
+
export declare const useFallbackPosition: (options: UseFallbackPositionOptions) => FallbackPosition;
|
|
58
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cscfi/csc-ui",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.24",
|
|
4
4
|
"description": "Vue 3-based replacement for @cscfi/csc-ui — same custom element tag names, Vue v-model contract.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/csc-ui.js",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"./custom-elements.json": "./dist/custom-elements.json"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
+
"@floating-ui/dom": "^1.7.6",
|
|
24
25
|
"@mdi/js": "^7.4.47",
|
|
25
|
-
"@oddbird/css-anchor-positioning": "^0.9.0",
|
|
26
26
|
"@tanstack/vue-table": "^8.21.3",
|
|
27
27
|
"culori": "^4.0.2",
|
|
28
28
|
"tailwind-merge": "^3.6.0",
|