@mica-js/editor 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +176 -2
- package/dist/index.d.ts +413 -0
- package/dist/index.js +7390 -0
- package/dist/index.js.map +1 -0
- package/dist/style.css +104 -0
- package/package.json +44 -3
package/dist/style.css
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Editor chrome, published as `@mica-js/editor/style.css`.
|
|
3
|
+
*
|
|
4
|
+
* The package never injects it at runtime: the host decides when the stylesheet loads, exactly like
|
|
5
|
+
* any other application CSS.
|
|
6
|
+
*/
|
|
7
|
+
.mica-schematic {
|
|
8
|
+
position: relative;
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: 100%;
|
|
11
|
+
min-height: 0;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
background: var(--mica-schematic-background);
|
|
14
|
+
color: var(--mica-schematic-ui-text);
|
|
15
|
+
font: 12px/1.45 var(--mica-schematic-font-family);
|
|
16
|
+
outline: none;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.mica-schematic__canvas-host {
|
|
20
|
+
position: absolute;
|
|
21
|
+
inset: 0;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.mica-schematic__canvas {
|
|
26
|
+
display: block;
|
|
27
|
+
width: 100%;
|
|
28
|
+
height: 100%;
|
|
29
|
+
touch-action: none;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Floating tool strip; the editor owns it so the canvas stays usable without a host toolbar. */
|
|
33
|
+
.mica-schematic__toolbar {
|
|
34
|
+
position: absolute;
|
|
35
|
+
top: 8px;
|
|
36
|
+
right: 8px;
|
|
37
|
+
z-index: 1;
|
|
38
|
+
display: flex;
|
|
39
|
+
gap: 4px;
|
|
40
|
+
align-items: center;
|
|
41
|
+
padding: 3px;
|
|
42
|
+
border: 1px solid var(--mica-schematic-ui-border);
|
|
43
|
+
border-radius: 8px;
|
|
44
|
+
background: color-mix(in srgb, var(--mica-schematic-ui-surface) 88%, transparent);
|
|
45
|
+
box-shadow: 0 4px 12px rgb(0 0 0 / 18%);
|
|
46
|
+
backdrop-filter: blur(6px);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.mica-schematic--no-toolbar .mica-schematic__toolbar {
|
|
50
|
+
display: none;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.mica-schematic__tool {
|
|
54
|
+
display: inline-flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
width: 26px;
|
|
58
|
+
height: 24px;
|
|
59
|
+
padding: 0;
|
|
60
|
+
border: 1px solid transparent;
|
|
61
|
+
border-radius: 6px;
|
|
62
|
+
background: transparent;
|
|
63
|
+
color: var(--mica-schematic-ui-muted-text);
|
|
64
|
+
font: inherit;
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.mica-schematic__tool:hover:not(:disabled) {
|
|
69
|
+
color: var(--mica-schematic-ui-text);
|
|
70
|
+
background: var(--mica-schematic-ui-border);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.mica-schematic__tool[aria-pressed='true'] {
|
|
74
|
+
background: var(--mica-schematic-ui-accent);
|
|
75
|
+
color: var(--mica-schematic-ui-accent-text);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.mica-schematic__tool:focus-visible {
|
|
79
|
+
outline: 2px solid var(--mica-schematic-focus-ring);
|
|
80
|
+
outline-offset: 1px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.mica-schematic__tool:disabled {
|
|
84
|
+
cursor: default;
|
|
85
|
+
opacity: 0.5;
|
|
86
|
+
}
|
|
87
|
+
/*
|
|
88
|
+
* Canvas editor surface, published as `@mica-js/editor/style.css`.
|
|
89
|
+
*
|
|
90
|
+
* The package never injects this stylesheet at runtime: the host decides when it loads, like any
|
|
91
|
+
* other application CSS. The view owns only this element, so the container keeps its own layout.
|
|
92
|
+
*/
|
|
93
|
+
.mica-canvas {
|
|
94
|
+
display: block;
|
|
95
|
+
width: 100%;
|
|
96
|
+
height: 100%;
|
|
97
|
+
background-color: #f4f4f5;
|
|
98
|
+
outline: none;
|
|
99
|
+
touch-action: none;
|
|
100
|
+
user-select: none;
|
|
101
|
+
-webkit-user-select: none;
|
|
102
|
+
-webkit-tap-highlight-color: transparent;
|
|
103
|
+
}
|
|
104
|
+
/*$vite$:1*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mica-js/editor",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Mica editors: independent composition roots, commands and scoped services",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/x-botlab/mica-js.git",
|
|
9
|
+
"directory": "packages/editor"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"sideEffects": [
|
|
13
|
+
"**/*.css"
|
|
14
|
+
],
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./style.css": "./dist/style.css"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@mica-js/core": "0.6.0",
|
|
30
|
+
"@mica-js/simulator": "2.1.0",
|
|
31
|
+
"@mica-js/sdk": "0.2.1",
|
|
32
|
+
"@mica-js/widget": "0.3.1",
|
|
33
|
+
"@mica-js/document": "0.1.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"typescript": "^6.0.3",
|
|
37
|
+
"vite": "^8.3.4",
|
|
38
|
+
"vite-plugin-dts": "^5.1.2",
|
|
39
|
+
"vitest": "^5.0.5"
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "vite build",
|
|
43
|
+
"test": "vitest run",
|
|
44
|
+
"test:watch": "vitest",
|
|
45
|
+
"typecheck": "tsc --noEmit"
|
|
46
|
+
}
|
|
6
47
|
}
|