@ggraphic/editor-chrome 0.0.0 → 0.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +2 -0
- package/README.md +47 -1
- package/THIRD_PARTY_NOTICES +4 -0
- package/dist/SidebarPanel.d.ts +2 -0
- package/dist/SidebarPanel.js +219 -0
- package/dist/SidebarTabBar.d.ts +7 -0
- package/dist/SidebarTabBar.js +35 -0
- package/dist/SubsectionTabBar.d.ts +15 -0
- package/dist/SubsectionTabBar.js +28 -0
- package/dist/cn.d.ts +2 -0
- package/dist/cn.js +66 -0
- package/dist/constants.d.ts +10 -0
- package/dist/constants.js +11 -0
- package/dist/focus.d.ts +3 -0
- package/dist/focus.js +9 -0
- package/dist/hooks/editorBox.d.ts +20 -0
- package/dist/hooks/editorBox.js +65 -0
- package/dist/hooks/useIsCanvasMobile.d.ts +9 -0
- package/dist/hooks/useIsCanvasMobile.js +28 -0
- package/dist/hooks/useMobileSheet.d.ts +48 -0
- package/dist/hooks/useMobileSheet.js +282 -0
- package/dist/hooks/useRovingToolbar.d.ts +17 -0
- package/dist/hooks/useRovingToolbar.js +76 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +11 -0
- package/dist/styles/chrome.css +77 -0
- package/dist/styles/tailwind.css +87 -0
- package/dist/styles/tokens.css +58 -0
- package/dist/types.d.ts +32 -0
- package/dist/types.js +1 -0
- package/package.json +54 -3
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { IconType } from 'react-icons';
|
|
3
|
+
/** One entry of the tab bar. `Id` narrows the ids a host knows (the editor's own union). */
|
|
4
|
+
export interface SidebarTab<Id extends string = string> {
|
|
5
|
+
id: Id;
|
|
6
|
+
icon: IconType;
|
|
7
|
+
label: string;
|
|
8
|
+
ariaLabel: string;
|
|
9
|
+
}
|
|
10
|
+
export interface SidebarTabBarProps<Id extends string = string> {
|
|
11
|
+
tabs: SidebarTab<Id>[];
|
|
12
|
+
activeTab: Id | null;
|
|
13
|
+
onTabClick: (tabId: Id) => void;
|
|
14
|
+
onExport?: () => void;
|
|
15
|
+
disabledTabs?: Id[];
|
|
16
|
+
horizontal?: boolean;
|
|
17
|
+
/** Accessible name of the tab bar's `<nav>`. */
|
|
18
|
+
ariaLabel?: string;
|
|
19
|
+
/** Desktop rail only: rendered below a separator under the tabs (the editor's save status). */
|
|
20
|
+
footer?: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export interface SidebarPanelProps {
|
|
23
|
+
isOpen: boolean;
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
/** Sheet title on mobile — the label of the active area. */
|
|
26
|
+
title?: string;
|
|
27
|
+
onClose?: () => void;
|
|
28
|
+
/** Label of the mobile sheet's close button, given the sheet title. */
|
|
29
|
+
closeLabel?: (title: string | null) => string;
|
|
30
|
+
/** Label of the desktop "collapse panel" handle. */
|
|
31
|
+
collapseLabel?: string;
|
|
32
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ggraphic/editor-chrome",
|
|
3
|
-
"version": "0.0.0",
|
|
3
|
+
"version": "0.1.0-alpha.0",
|
|
4
4
|
"description": "ggraphic editor chrome: the sidebar shell (tab rail, flyout panel, mobile sheet) with its tokens, without the canvas editor",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -8,5 +8,56 @@
|
|
|
8
8
|
"url": "git+https://github.com/Movm/ggraphic.git",
|
|
9
9
|
"directory": "packages/editor-chrome"
|
|
10
10
|
},
|
|
11
|
-
"
|
|
12
|
-
|
|
11
|
+
"type": "module",
|
|
12
|
+
"sideEffects": [
|
|
13
|
+
"**/*.css"
|
|
14
|
+
],
|
|
15
|
+
"main": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js",
|
|
21
|
+
"default": "./dist/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./tokens.css": "./dist/styles/tokens.css",
|
|
24
|
+
"./styles.css": "./dist/styles/chrome.css",
|
|
25
|
+
"./tailwind.css": "./dist/styles/tailwind.css"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"clsx": "^2.1.1",
|
|
29
|
+
"react-icons": "^5.7.0",
|
|
30
|
+
"tailwind-merge": "^3.7.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
34
|
+
"@testing-library/react": "^16.3.3",
|
|
35
|
+
"@testing-library/user-event": "^14.6.8",
|
|
36
|
+
"@types/node": "^26.3.0",
|
|
37
|
+
"@types/react": "19.3.0",
|
|
38
|
+
"@types/react-dom": "^19.3.0",
|
|
39
|
+
"jsdom": "30.1.3",
|
|
40
|
+
"react": "19.3.1",
|
|
41
|
+
"react-dom": "19.3.1",
|
|
42
|
+
"typescript": "^6.0.3",
|
|
43
|
+
"vitest": "^5.0.5",
|
|
44
|
+
"vitest-axe": "^0.1.0"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"react": "^19.0.0",
|
|
48
|
+
"react-dom": "^19.0.0"
|
|
49
|
+
},
|
|
50
|
+
"files": [
|
|
51
|
+
"dist",
|
|
52
|
+
"LICENSE",
|
|
53
|
+
"NOTICE",
|
|
54
|
+
"README.md",
|
|
55
|
+
"THIRD_PARTY_NOTICES"
|
|
56
|
+
],
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "tsc --project tsconfig.build.json && node -e \"require('node:fs').cpSync('src/styles', 'dist/styles', { recursive: true })\"",
|
|
59
|
+
"lint": "eslint .",
|
|
60
|
+
"test": "vitest run",
|
|
61
|
+
"typecheck": "tsc --noEmit"
|
|
62
|
+
}
|
|
63
|
+
}
|