@widgetic/canvas 0.5.34 → 0.5.36

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.
Files changed (212) hide show
  1. package/README.md +105 -36
  2. package/dist/canvas/DomCanvas.svelte +454 -0
  3. package/dist/canvas/DomCanvas.svelte.d.ts +222 -0
  4. package/dist/canvas/autosaveScheduler.d.ts +58 -0
  5. package/dist/canvas/autosaveScheduler.js +157 -0
  6. package/dist/canvas/boardFrame.d.ts +13 -0
  7. package/dist/canvas/boardFrame.js +13 -0
  8. package/dist/canvas/boardSurface.d.ts +9 -0
  9. package/dist/canvas/boardSurface.js +9 -0
  10. package/dist/canvas/chromeLayout.d.ts +76 -0
  11. package/dist/canvas/chromeLayout.js +121 -0
  12. package/dist/canvas/emptyBoardHint.d.ts +17 -0
  13. package/dist/canvas/emptyBoardHint.js +12 -0
  14. package/dist/canvas/eventScope.d.ts +1 -1
  15. package/dist/canvas/eventScope.js +1 -1
  16. package/dist/canvas/host/CanvasHost.d.ts +351 -0
  17. package/dist/canvas/host/CanvasHost.js +1740 -0
  18. package/dist/canvas/host/CanvasHostApi.d.ts +30 -0
  19. package/dist/canvas/host/CanvasHostApi.js +95 -0
  20. package/dist/canvas/host/browserServices.d.ts +46 -0
  21. package/dist/canvas/host/browserServices.js +167 -0
  22. package/dist/canvas/host/conversion.d.ts +51 -0
  23. package/dist/canvas/host/conversion.js +123 -0
  24. package/dist/canvas/host/hostObject.d.ts +40 -0
  25. package/dist/canvas/host/hostObject.js +93 -0
  26. package/dist/canvas/host/pageEvents.d.ts +24 -0
  27. package/dist/canvas/host/pageEvents.js +35 -0
  28. package/dist/canvas/host/screenRects.d.ts +66 -0
  29. package/dist/canvas/host/screenRects.js +102 -0
  30. package/dist/canvas/host/strokeSnap.d.ts +67 -0
  31. package/dist/canvas/host/strokeSnap.js +165 -0
  32. package/dist/canvas/index.d.ts +9 -7
  33. package/dist/canvas/index.js +9 -7
  34. package/dist/canvas/openMarks.d.ts +17 -0
  35. package/dist/canvas/openMarks.js +26 -0
  36. package/dist/canvas/panZoomPosition.d.ts +15 -0
  37. package/dist/canvas/panZoomPosition.js +16 -0
  38. package/dist/canvas/preferredTextFont.d.ts +12 -0
  39. package/dist/canvas/preferredTextFont.js +38 -0
  40. package/dist/canvas/shapes/ShapeLibrary.d.ts +1 -1
  41. package/dist/canvas/shapes/ShapeLibrary.js +13 -1
  42. package/dist/canvas/shapes/strokeShapeSnap.d.ts +14 -12
  43. package/dist/canvas/shapes/strokeShapeSnap.js +10 -8
  44. package/dist/canvas/toolbarPosition.d.ts +24 -0
  45. package/dist/canvas/toolbarPosition.js +24 -0
  46. package/dist/canvas/types.d.ts +14 -0
  47. package/dist/canvas/ui/CanvasContextMenu.svelte +173 -0
  48. package/dist/canvas/ui/CanvasContextMenu.svelte.d.ts +12 -0
  49. package/dist/canvas/ui/CanvasHint.svelte +20 -0
  50. package/dist/canvas/ui/CanvasHint.svelte.d.ts +18 -0
  51. package/dist/canvas/ui/CanvasToolbar.svelte +95 -0
  52. package/dist/canvas/ui/CanvasToolbar.svelte.d.ts +14 -0
  53. package/dist/canvas/ui/ColorField.svelte +155 -0
  54. package/dist/canvas/ui/ColorField.svelte.d.ts +14 -0
  55. package/dist/canvas/ui/LoadNotice.svelte +39 -0
  56. package/dist/canvas/ui/LoadNotice.svelte.d.ts +8 -0
  57. package/dist/canvas/ui/SelectionPanel.svelte +300 -0
  58. package/dist/canvas/ui/SelectionPanel.svelte.d.ts +20 -0
  59. package/dist/canvas/ui/SelectorBar.svelte +82 -0
  60. package/dist/canvas/ui/SelectorBar.svelte.d.ts +12 -0
  61. package/dist/canvas/ui/ShapesMenu.svelte +185 -0
  62. package/dist/canvas/ui/ShapesMenu.svelte.d.ts +15 -0
  63. package/dist/canvas/ui/ShortcutsPanel.svelte +124 -0
  64. package/dist/canvas/ui/ShortcutsPanel.svelte.d.ts +7 -0
  65. package/dist/canvas/ui/ToolButton.svelte +78 -0
  66. package/dist/canvas/ui/ToolButton.svelte.d.ts +20 -0
  67. package/dist/canvas/ui/WidgetActions.svelte +152 -0
  68. package/dist/canvas/ui/WidgetActions.svelte.d.ts +19 -0
  69. package/dist/canvas/ui/ZoomControl.svelte +89 -0
  70. package/dist/canvas/ui/ZoomControl.svelte.d.ts +18 -0
  71. package/dist/canvas/ui/colorModel.d.ts +18 -0
  72. package/dist/canvas/ui/colorModel.js +85 -0
  73. package/dist/canvas/ui/colorPickerMessages.d.ts +5 -0
  74. package/dist/canvas/ui/colorPickerMessages.js +15 -0
  75. package/dist/canvas/ui/floatingCard.d.ts +107 -0
  76. package/dist/canvas/ui/floatingCard.js +107 -0
  77. package/dist/canvas/ui/floatingLayer.d.ts +21 -0
  78. package/dist/canvas/ui/floatingLayer.js +52 -0
  79. package/dist/canvas/ui/icons.d.ts +12 -0
  80. package/dist/canvas/ui/icons.js +7 -0
  81. package/dist/canvas/ui/keyHints.d.ts +27 -0
  82. package/dist/canvas/ui/keyHints.js +43 -0
  83. package/dist/canvas/ui/popoverSide.d.ts +5 -0
  84. package/dist/canvas/ui/popoverSide.js +20 -0
  85. package/dist/canvas/ui/selectionTraits.d.ts +61 -0
  86. package/dist/canvas/ui/selectionTraits.js +99 -0
  87. package/dist/canvas/view/CanvasStage.svelte +132 -0
  88. package/dist/canvas/view/CanvasStage.svelte.d.ts +21 -0
  89. package/dist/canvas/view/EraserTrail.svelte +50 -0
  90. package/dist/canvas/view/EraserTrail.svelte.d.ts +9 -0
  91. package/dist/canvas/view/ObjectView.svelte +245 -0
  92. package/dist/canvas/view/ObjectView.svelte.d.ts +21 -0
  93. package/dist/canvas/view/SelectionOverlay.svelte +487 -0
  94. package/dist/canvas/view/SelectionOverlay.svelte.d.ts +17 -0
  95. package/dist/canvas/view/TextEditor.svelte +76 -0
  96. package/dist/canvas/view/TextEditor.svelte.d.ts +9 -0
  97. package/dist/canvas/view/WidgetChromeLayer.svelte +83 -0
  98. package/dist/canvas/view/WidgetChromeLayer.svelte.d.ts +13 -0
  99. package/dist/canvas/view/erasingMarks.d.ts +13 -0
  100. package/dist/canvas/view/erasingMarks.js +34 -0
  101. package/dist/canvas/view/geometry.d.ts +169 -0
  102. package/dist/canvas/view/geometry.js +272 -0
  103. package/dist/components/CanvasBoardPlaceholder.svelte +5 -3
  104. package/dist/components/CanvasBoardPlaceholder.svelte.d.ts +3 -3
  105. package/dist/components/index.js +1 -1
  106. package/dist/components/input-controls/ColorIC.svelte +2 -2
  107. package/dist/engine/EngineCore.d.ts +273 -0
  108. package/dist/engine/EngineCore.js +1051 -0
  109. package/dist/engine/codec/canvasDocument.d.ts +57 -0
  110. package/dist/engine/codec/canvasDocument.js +471 -0
  111. package/dist/engine/codec/hostReadableKeys.d.ts +25 -0
  112. package/dist/engine/codec/hostReadableKeys.js +25 -0
  113. package/dist/engine/core/arrange.d.ts +20 -0
  114. package/dist/engine/core/arrange.js +81 -0
  115. package/dist/engine/core/arrow.d.ts +91 -0
  116. package/dist/engine/core/arrow.js +182 -0
  117. package/dist/engine/core/brush.d.ts +68 -0
  118. package/dist/engine/core/brush.js +173 -0
  119. package/dist/engine/core/defaults.d.ts +70 -0
  120. package/dist/engine/core/defaults.js +158 -0
  121. package/dist/engine/core/freehand.d.ts +130 -0
  122. package/dist/engine/core/freehand.js +430 -0
  123. package/dist/engine/core/geometry.d.ts +44 -0
  124. package/dist/engine/core/geometry.js +216 -0
  125. package/dist/engine/core/history.d.ts +39 -0
  126. package/dist/engine/core/history.js +69 -0
  127. package/dist/engine/core/hitTest.d.ts +54 -0
  128. package/dist/engine/core/hitTest.js +298 -0
  129. package/dist/engine/core/matrix.d.ts +47 -0
  130. package/dist/engine/core/matrix.js +101 -0
  131. package/dist/engine/core/pathData.d.ts +50 -0
  132. package/dist/engine/core/pathData.js +550 -0
  133. package/dist/engine/core/rotationReset.d.ts +10 -0
  134. package/dist/engine/core/rotationReset.js +17 -0
  135. package/dist/engine/core/scene.d.ts +99 -0
  136. package/dist/engine/core/scene.js +450 -0
  137. package/dist/engine/core/scribble.d.ts +64 -0
  138. package/dist/engine/core/scribble.js +121 -0
  139. package/dist/engine/core/shapePaths.d.ts +34 -0
  140. package/dist/engine/core/shapePaths.js +69 -0
  141. package/dist/engine/core/shapeTools.d.ts +80 -0
  142. package/dist/engine/core/shapeTools.js +161 -0
  143. package/dist/engine/core/snapping.d.ts +64 -0
  144. package/dist/engine/core/snapping.js +164 -0
  145. package/dist/engine/core/style.d.ts +40 -0
  146. package/dist/engine/core/style.js +151 -0
  147. package/dist/engine/core/transform.d.ts +79 -0
  148. package/dist/engine/core/transform.js +258 -0
  149. package/dist/engine/core/types.d.ts +238 -0
  150. package/dist/engine/core/types.js +31 -0
  151. package/dist/engine/core/viewport.d.ts +32 -0
  152. package/dist/engine/core/viewport.js +84 -0
  153. package/dist/engine/input/PointerController.d.ts +38 -0
  154. package/dist/engine/input/PointerController.js +545 -0
  155. package/dist/engine/input/arrowHandles.d.ts +38 -0
  156. package/dist/engine/input/arrowHandles.js +60 -0
  157. package/dist/engine/input/gestures.d.ts +79 -0
  158. package/dist/engine/input/gestures.js +769 -0
  159. package/dist/engine/input/hoverCursor.d.ts +29 -0
  160. package/dist/engine/input/hoverCursor.js +23 -0
  161. package/dist/engine/input/keyboard.d.ts +75 -0
  162. package/dist/engine/input/keyboard.js +264 -0
  163. package/dist/engine/input/selectionHandles.d.ts +89 -0
  164. package/dist/engine/input/selectionHandles.js +169 -0
  165. package/dist/engine/input/types.d.ts +82 -0
  166. package/dist/engine/input/types.js +5 -0
  167. package/dist/engine/render/rasterize.d.ts +74 -0
  168. package/dist/engine/render/rasterize.js +273 -0
  169. package/dist/engine/state.d.ts +124 -0
  170. package/dist/engine/state.js +47 -0
  171. package/dist/engine/text/layoutText.d.ts +53 -0
  172. package/dist/engine/text/layoutText.js +170 -0
  173. package/dist/engine/widgets.d.ts +124 -0
  174. package/dist/engine/widgets.js +345 -0
  175. package/dist/i18n/labels.d.ts +4 -15
  176. package/dist/i18n/labels.js +33 -53
  177. package/dist/i18n/language.d.ts +3 -3
  178. package/dist/i18n/messages.d.ts +51 -122
  179. package/dist/i18n/messages.js +58 -131
  180. package/dist/i18n/shortcuts.d.ts +0 -1
  181. package/dist/i18n/shortcuts.js +2 -11
  182. package/dist/index.d.ts +6 -2
  183. package/dist/index.js +6 -2
  184. package/package.json +30 -5
  185. package/dist/canvas/Canvas.svelte +0 -13299
  186. package/dist/canvas/Canvas.svelte.d.ts +0 -281
  187. package/dist/canvas/CanvasToolbar.svelte +0 -1498
  188. package/dist/canvas/CanvasToolbar.svelte.d.ts +0 -69
  189. package/dist/canvas/ContextMenu.svelte +0 -305
  190. package/dist/canvas/ContextMenu.svelte.d.ts +0 -42
  191. package/dist/canvas/PanZoomPanel.svelte +0 -478
  192. package/dist/canvas/PanZoomPanel.svelte.d.ts +0 -38
  193. package/dist/canvas/WidgetSelectionLayer.svelte +0 -156
  194. package/dist/canvas/WidgetSelectionLayer.svelte.d.ts +0 -11
  195. package/dist/canvas/props-panel/PropsPanel.svelte +0 -2075
  196. package/dist/canvas/props-panel/PropsPanel.svelte.d.ts +0 -84
  197. package/dist/canvas/props-panel/TextPropsICSection.svelte +0 -242
  198. package/dist/canvas/props-panel/TextPropsICSection.svelte.d.ts +0 -40
  199. package/dist/canvas/shadowRootText.d.ts +0 -5
  200. package/dist/canvas/shadowRootText.js +0 -43
  201. package/dist/canvas/shapes/FrameShape.d.ts +0 -97
  202. package/dist/canvas/shapes/FrameShape.js +0 -953
  203. package/dist/canvas/shapes/ImageShape.d.ts +0 -47
  204. package/dist/canvas/shapes/ImageShape.js +0 -339
  205. package/dist/canvas/shapes/WidgetShape.d.ts +0 -30
  206. package/dist/canvas/shapes/WidgetShape.js +0 -200
  207. package/dist/canvas/widgetPreviewGeometry.d.ts +0 -19
  208. package/dist/canvas/widgetPreviewGeometry.js +0 -66
  209. package/dist/i18n/shapeWords.d.ts +0 -30
  210. package/dist/i18n/shapeWords.js +0 -36
  211. package/dist/i18n/slots.d.ts +0 -20
  212. package/dist/i18n/slots.js +0 -40
@@ -1,2075 +0,0 @@
1
- <script lang="ts">
2
- import ColorIC from '../../components/input-controls/ColorIC.svelte';
3
- import SliderUnitIC from '../../components/input-controls/SliderUnitIC.svelte';
4
- import TextPropsICSection from './TextPropsICSection.svelte';
5
- import TextAlignIC from '../../components/input-controls/TextAlignIC.svelte';
6
- import FontSelectorIC from '../../components/input-controls/FontSelectorIC.svelte';
7
- import TextStyleIC from '../../components/input-controls/TextStyleIC.svelte';
8
- import Tooltip from '../../components/Tooltip.svelte';
9
- import { useCanvasLanguage } from '../../i18n/language.js';
10
- import { displayTypeText } from '../../i18n/labels.js';
11
-
12
- // The words of the panel, in the language of the canvas it is on (English when it is used on its own)
13
- const { t } = useCanvasLanguage();
14
-
15
- let className = '';
16
- export { className as class };
17
- export let style = '';
18
-
19
- // Selected object from Canvas
20
- export let selectedObject: any = null;
21
-
22
- // Wireframe mode: when true, hides color pickers so the panel focuses on
23
- // structural properties (size, position, font, stroke width, etc.).
24
- // Opacity is always shown — useful for hiding objects without deleting them.
25
- export let wireframeMode: boolean = false;
26
-
27
- // Callback functions for property changes - General
28
- export let onFillChange: (color: string) => void = () => {};
29
- export let onStrokeChange: (color: string) => void = () => {};
30
- export let onStrokeWidthChange: (width: number) => void = () => {};
31
- export let onRoundnessChange: (roundness: number) => void = () => {};
32
- export let onStrokeTypeChange: (type: 'solid' | 'dashed' | 'dotted') => void = () => {};
33
- export let onOpacityChange: (opacity: number) => void = () => {};
34
- export let onFillOpacityChange: (opacity: number) => void = () => {};
35
- export let onGroupFillChange: (color: string) => void = () => {};
36
- export let onGroupFillOpacityChange: (opacity: number) => void = () => {};
37
- export let onGroupStrokeChange: (color: string) => void = () => {};
38
- export let onGroupStrokeWidthChange: (width: number) => void = () => {};
39
- export let onGroupStrokeTypeChange: (type: 'solid' | 'dashed' | 'dotted') => void = () => {};
40
- export let onBackgroundColorChange: (color: string) => void = () => {};
41
- export let onBackgroundOpacityChange: (opacity: number) => void = () => {};
42
-
43
- // Callback functions for text properties
44
- export let onFontSizeChange: (size: number) => void = () => {};
45
- export let onFontFamilyChange: (family: string) => void = () => {};
46
- export let onFontWeightChange: (weight: 'normal' | 'bold') => void = () => {};
47
- export let onFontStyleChange: (style: 'normal' | 'italic') => void = () => {};
48
- export let onUnderlineChange: (underline: boolean) => void = () => {};
49
- export let onTextAlignChange: (align: 'left' | 'center' | 'right') => void = () => {};
50
- export let onTextPaddingChange: (padding: number) => void = () => {};
51
- export let onTextColorChange: (color: string) => void = () => {};
52
-
53
- // Callback functions for frame properties
54
- export let onFrameLabelChange: (label: string) => void = () => {};
55
-
56
- // Callback functions for frame label text properties
57
- export let onFrameLabelFontSizeChange: (size: number) => void = () => {};
58
- export let onFrameLabelFontFamilyChange: (family: string) => void = () => {};
59
- export let onFrameLabelTextAlignChange: (align: 'left' | 'center' | 'right') => void = () => {};
60
- export let onFrameLabelTextColorChange: (color: string) => void = () => {};
61
- export let onFrameLabelFontWeightChange: (weight: 'normal' | 'bold') => void = () => {};
62
- export let onFrameLabelFontStyleChange: (style: 'normal' | 'italic') => void = () => {};
63
- export let onFrameLabelUnderlineChange: (underline: boolean) => void = () => {};
64
- export let onFrameLabelBackgroundColorChange: (color: string) => void = () => {};
65
-
66
- // Callback functions for textbox box properties
67
- export let onTextboxBoxFillChange: (color: string) => void = () => {};
68
- export let onTextboxBoxStrokeChange: (color: string) => void = () => {};
69
- export let onTextboxBoxStrokeWidthChange: (width: number) => void = () => {};
70
- export let onTextboxBoxStrokeTypeChange: (type: 'solid' | 'dashed' | 'dotted') => void = () => {};
71
-
72
- // Callback functions for text stroke properties (stroke on the text itself)
73
- export let onTextStrokeColorChange: (color: string) => void = () => {};
74
- export let onTextStrokeWidthChange: (width: number) => void = () => {};
75
-
76
- // Callback functions for image properties
77
- export let onImageUrlLoad: (url: string) => void = () => {};
78
- export let onImageSourceChange: () => void = () => {};
79
-
80
- // Callback for capture action (captures screenshot and fires onObjectClick)
81
- export let onCapture: (() => void) | null = null;
82
-
83
- // Callback for "Convert to Widget" action (serializes frame + children, emits to host)
84
- export let onConvertToWidget: (() => void) | null = null;
85
-
86
- // Callback: fires when the user clicks the linked widget badge to open widget details
87
- export let onWidgetClick: ((widgetId: string) => void) | null = null;
88
-
89
- // Callback: fires when the user renames a widget from the Props Panel
90
- export let onWidgetRename: ((widgetId: string, newName: string) => void) | null = null;
91
-
92
- // Callback: fires when the user requests a screenshot refresh for the linked widget
93
- export let onRefreshScreenshot: ((widgetId: string) => void) | null = null;
94
- export let onSetAsPrimary: ((widgetId: string) => void) | null = null;
95
-
96
- // Widget name resolver: given a widgetId, returns the widget name (or null)
97
- export let getWidgetName: ((widgetId: string) => string | null) | null = null;
98
- /** Bumped when names change so PropsPanel re-reads getWidgetName. */
99
- export let widgetNameRevision: number = 0;
100
- /** Returns false when the linked widget was deleted or moved off this canvas. */
101
- export let isWidgetKnown: ((widgetId: string) => boolean) | null = null;
102
- /** Remove the selected orphaned widget shape from the canvas. */
103
- export let onRemoveOrphanedShape: (() => void) | null = null;
104
-
105
- // Callback functions for layer ordering
106
- export let onBringToFront: () => void = () => {};
107
- export let onBringForward: () => void = () => {};
108
- export let onSendBackward: () => void = () => {};
109
- export let onSendToBack: () => void = () => {};
110
-
111
- // Callback functions for alignment
112
- // Single object → aligns to canvas edges; multiple objects → aligns to each other
113
- export let onAlignLeft: () => void = () => {};
114
- export let onAlignCenterH: () => void = () => {};
115
- export let onAlignRight: () => void = () => {};
116
- export let onAlignTop: () => void = () => {};
117
- export let onAlignMiddleV: () => void = () => {};
118
- export let onAlignBottom: () => void = () => {};
119
-
120
- // Callback functions for dimensions
121
- export let onWidthChange: (width: number) => void = () => {};
122
- export let onHeightChange: (height: number) => void = () => {};
123
-
124
- const wireframeColorValues = ['#000000', '#555555', '#999999', '#CCCCCC', '#FFFFFF'];
125
-
126
- // Derived properties from selected object
127
- $: objectType = selectedObject?.type ?? 'None';
128
- $: customType = selectedObject?._customType ?? null;
129
- $: isFrame = customType === 'frame' || objectType === 'frame';
130
- // WidgetShape is a Rect subclass with _customType === 'image'
131
- // isImagePlaceholder: when no image loaded yet (_hasImage is false)
132
- $: isImagePlaceholder = (customType === 'image' || customType === 'video') && !selectedObject?._hasImage;
133
- $: isRect = objectType === 'rect' && !isFrame && customType !== 'image' && customType !== 'video';
134
- $: isTextbox = objectType === 'textbox';
135
- $: isPath = objectType === 'path' && !customType;
136
- $: isArrow = objectType === 'path' && customType === 'arrow';
137
- $: isTriangle = objectType === 'path' && customType === 'triangle';
138
- // Library shapes whose cornerRadiusMode is 'none' (circle, heart) should NOT show the slider
139
- $: libraryCornerRadiusMode = (selectedObject as any)?._cornerRadiusMode ?? null;
140
- $: isLibraryShape = objectType === 'path' && customType === 'libraryShape' && libraryCornerRadiusMode !== 'none';
141
- $: isCircle = objectType === 'circle';
142
- $: isEllipse = objectType === 'ellipse';
143
- $: isGroup = objectType === 'group';
144
- $: isActiveSelection = objectType === 'activeSelection' || objectType === 'activeselection';
145
- // FrameShape objects have type === 'FrameShape', not 'group', so isGroup is always false for them.
146
- // isMultiSelect is only true for plain Groups and ActiveSelections (not Frames).
147
- $: isMultiSelect = (isGroup && !isFrame) || isActiveSelection;
148
- $: isPlainGroup = isGroup && !isFrame;
149
- $: isLine = objectType === 'line';
150
- $: isImage = objectType === 'image' || customType === 'image' || customType === 'video';
151
- // Widget link: true when the selected object has already been converted to a widget
152
- $: hasWidgetId = !!selectedObject?._widgetId;
153
- $: widgetId = selectedObject?._widgetId ?? null;
154
- $: isWidgetImage = !!selectedObject?._isWidgetImage;
155
- $: isPendingWidgetLink = !!selectedObject?._pendingWidgetLink;
156
- $: isDuplicating = !!selectedObject?._isDuplicating;
157
- $: isConverting = !!selectedObject?._isConverting;
158
- $: showWidgetLoader = isPendingWidgetLink || isDuplicating || isConverting;
159
- // Reading widgetNameRevision registers it as a dependency so renamed
160
- // widgets re-resolve; the value itself is unused.
161
- $: void widgetNameRevision;
162
- $: resolvedWidgetName = widgetId && getWidgetName
163
- ? getWidgetName(widgetId)
164
- : null;
165
- $: isOrphanedWidgetShape = !!(
166
- widgetId
167
- && hasWidgetId
168
- && isWidgetKnown
169
- && !isWidgetKnown(widgetId)
170
- );
171
-
172
- let widgetRenameValue = '';
173
-
174
- // Children count for containers (frames exclude the background rect, groups/selections count all)
175
- $: childrenCount = getChildrenCount(selectedObject);
176
- function getChildrenCount(obj: any): number | null {
177
- if (!obj) return null;
178
- if (obj._customType === 'frame' && obj.getObjects) {
179
- return obj.getObjects().filter((child: any) => !child._isFrameBackground).length;
180
- }
181
- if ((obj.type === 'group' || obj.type === 'activeSelection' || obj.type === 'activeselection') && obj.getObjects) {
182
- return obj.getObjects().length;
183
- }
184
- return null;
185
- }
186
-
187
- // Check if selection/group contains textboxes or frames (for showing Text Properties section).
188
- // Explicitly exclude Frames: Frame children should not drive the Text Properties section.
189
- $: hasTextboxInSelection = isMultiSelect && !isFrame && selectedObject?.getObjects?.()?.some((obj: any) =>
190
- obj.type === 'textbox' || obj._customType === 'frame'
191
- );
192
-
193
- // Has certain properties
194
- // For Frames: hasFill/hasStroke is always true (background rect has fill/stroke)
195
- $: hasStroke = selectedObject && ('stroke' in selectedObject || isFrame);
196
- // Plain Drawing paths (isPath) are now included so users can set fill color on freehand shapes.
197
- // Arrows and lines remain excluded (they are stroke-only by nature).
198
- $: hasFill = selectedObject && ('fill' in selectedObject || isFrame) && !isLine && !isArrow;
199
-
200
- // Get display name for object type, in the page's language (the names are in i18n/labels.ts)
201
- $: displayType = displayTypeText(selectedObject, $t);
202
-
203
- // Get current values from selected object
204
- // For Frames (Group-based), read fill/stroke from custom properties (_frameFill, _frameStroke)
205
- // because the actual fill/stroke is on the background Rect child, not the Group itself
206
- $: usesPathBackgroundFill = selectedObject?._cornerRadiusMode === 'strokeRound'
207
- || ['cross', 'plus', 'minus', 'check'].includes(selectedObject?._shapeKey);
208
- $: currentFill = isFrame
209
- ? (selectedObject?._frameFill ?? '#FFFFFF')
210
- : (usesPathBackgroundFill
211
- ? (selectedObject?._iconFill || selectedObject?.backgroundColor || '#FFFFFF')
212
- : (selectedObject?.fill ?? '#FFFFFF'));
213
- $: currentFillOpacity = Math.round((selectedObject?._fillOpacity ?? 1) * 100);
214
- $: currentStroke = isFrame ? (selectedObject?._frameStroke ?? '#000000') : (selectedObject?.stroke ?? '#000000');
215
- $: currentStrokeWidth = isFrame ? (selectedObject?._frameStrokeWidth ?? 1) : (selectedObject?.strokeWidth ?? 1);
216
- // Corner roundness is stored as percentage (0-100%) in _cornerRoundness for all objects
217
- // 100% = perfect circle (for square shapes)
218
- $: currentRoundness = selectedObject?._cornerRoundness ?? 0;
219
- $: currentTriangleRoundness = selectedObject?._cornerRoundness ?? 0;
220
- $: currentOpacity = Math.round((selectedObject?.opacity ?? 1) * 100);
221
- $: currentBackgroundColor = selectedObject?.backgroundColor || 'transparent';
222
- $: currentBackgroundOpacity = Math.round((selectedObject?._backgroundOpacity ?? 1) * 100);
223
- // For Frames, stroke dash is stored on _frameStrokeDashArray (the background Rect's
224
- // strokeDashArray is on a child, not the Group itself, so reading it directly is unreliable).
225
- $: currentStrokeType = getStrokeType(
226
- isFrame
227
- ? (selectedObject as any)?._frameStrokeDashArray
228
- : selectedObject?.strokeDashArray
229
- );
230
- $: groupFill = selectedObject?._groupFill ?? '#FFFFFF';
231
- $: groupFillOpacity = Math.round((selectedObject?._groupFillOpacity ?? 1) * 100);
232
- $: groupStroke = selectedObject?._groupStroke ?? '#000000';
233
- $: groupStrokeWidth = selectedObject?._groupStrokeWidth ?? 0;
234
- $: groupStrokeType = getStrokeType((selectedObject as any)?._groupStrokeDashArray);
235
-
236
- // Text properties - for groups, get from first textbox
237
- $: firstTextboxInGroup = (selectedObject?.type === 'group' || selectedObject?.type === 'activeSelection' || selectedObject?.type === 'activeselection')
238
- ? selectedObject?.getObjects?.()?.find((obj: any) => obj.type === 'textbox')
239
- : null;
240
- $: currentFontSize = firstTextboxInGroup?.fontSize ?? selectedObject?.fontSize ?? 28;
241
- $: currentFontFamily = firstTextboxInGroup?.fontFamily ?? selectedObject?.fontFamily ?? 'Arial';
242
- $: currentFontWeight = firstTextboxInGroup?.fontWeight ?? selectedObject?.fontWeight ?? 'normal';
243
- $: currentFontStyle = firstTextboxInGroup?.fontStyle ?? selectedObject?.fontStyle ?? 'normal';
244
- $: currentUnderline = firstTextboxInGroup?.underline ?? selectedObject?.underline ?? false;
245
- $: currentTextAlign = firstTextboxInGroup?.textAlign ?? selectedObject?.textAlign ?? 'left';
246
- $: currentTextPadding = firstTextboxInGroup?._textPadding ?? selectedObject?._textPadding ?? 0;
247
-
248
- // Frame label properties (using new custom properties)
249
- $: currentFrameLabel = selectedObject?._labelText ?? $t('canvas.defaults.frameLabel');
250
- $: frameLabelFontSize = selectedObject?._labelFontSize ?? 16;
251
- $: frameLabelFontFamily = selectedObject?._labelFontFamily ?? 'Arial';
252
- $: frameLabelTextAlign = selectedObject?._labelTextAlign ?? 'left';
253
- $: frameLabelTextColor = selectedObject?._labelColor ?? '#000000';
254
- $: frameLabelFontWeight = selectedObject?._labelFontWeight ?? 'normal';
255
- $: frameLabelFontStyle = selectedObject?._labelFontStyle ?? 'normal';
256
- $: frameLabelUnderline = selectedObject?._labelUnderline ?? false;
257
- $: frameLabelBackgroundColor = selectedObject?._labelBackgroundColor ?? '#ffffff';
258
-
259
- // Text stroke properties (stroke on the text itself - Fabric's native stroke)
260
- $: textStrokeColor = selectedObject?.stroke ?? '#000000';
261
- // Show 0px when stroke is null/undefined (no visible stroke)
262
- $: textStrokeWidth = selectedObject?.stroke ? (selectedObject?.strokeWidth ?? 1) : 0;
263
-
264
- // Textbox box properties
265
- $: textboxBoxFill = selectedObject?.backgroundColor ?? 'transparent';
266
- // Box fill opacity: show 0% when backgroundColor is effectively invisible
267
- // (transparent, unset, or rgba with alpha=0 like 'rgba(255,255,255,0)')
268
- $: textboxBoxFillIsInvisible = !textboxBoxFill
269
- || textboxBoxFill === 'transparent'
270
- || /rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*0\s*\)/.test(textboxBoxFill);
271
- $: textboxBoxFillOpacity = textboxBoxFillIsInvisible ? 0 : currentFillOpacity;
272
- // Box stroke uses custom properties (_boxStroke, _boxStrokeWidth, _boxStrokeDashArray)
273
- $: textboxBoxStroke = selectedObject?._boxStroke ?? '#000000';
274
- $: textboxBoxStrokeWidth = selectedObject?._boxStrokeWidth ?? 0;
275
- $: textboxBoxStrokeType = getStrokeType(selectedObject?._boxStrokeDashArray);
276
-
277
- // Image properties (WidgetShape is a Rect subclass)
278
- $: imageFilename = selectedObject?._originalFilename ?? '';
279
- $: imageUrl = selectedObject?._imageUrl ?? '';
280
- // hasLoadedImage: when _hasImage is true (image data loaded into WidgetShape)
281
- $: hasLoadedImage = isImage && selectedObject?._hasImage;
282
-
283
- // URL input state
284
- let imageUrlInput = '';
285
-
286
- function getStrokeType(dashArray: number[] | null | undefined): 'solid' | 'dashed' | 'dotted' {
287
- if (!dashArray || dashArray.length === 0) return 'solid';
288
- if (dashArray[0] >= 8) return 'dashed';
289
- return 'dotted';
290
- }
291
-
292
- function handleFrameLabelInput(e: Event) {
293
- const input = e.target as HTMLInputElement;
294
- onFrameLabelChange(input.value);
295
- }
296
-
297
- // ── Dimensions (real size at 100% zoom) ──
298
- // Fabric stores width/height as the "natural" dimensions; scaleX/scaleY multiply them.
299
- // For Ellipse: Fabric uses rx/ry (radii), so displayed diameter = 2 * rx * scaleX.
300
- $: objScaleX = selectedObject?.scaleX ?? 1;
301
- $: objScaleY = selectedObject?.scaleY ?? 1;
302
- $: rawWidth = selectedObject?.type === 'ellipse'
303
- ? (selectedObject?.rx ?? 0) * 2
304
- : (selectedObject?.width ?? 0);
305
- $: rawHeight = selectedObject?.type === 'ellipse'
306
- ? (selectedObject?.ry ?? 0) * 2
307
- : (selectedObject?.height ?? 0);
308
- $: displayWidth = Math.round(rawWidth * objScaleX);
309
- $: displayHeight = Math.round(rawHeight * objScaleY);
310
- // Forced lock: shapes created with _lockAspectRatio (hexagon, circle, etc.) cannot be unlocked
311
- $: forcedLock = !!(selectedObject as any)?._forceLockAspectRatio;
312
- // Current lock state from the object (may have been toggled by user)
313
- $: dimensionLocked = !!(selectedObject as any)?._lockAspectRatio;
314
-
315
- // User toggle state (reset when selected object changes)
316
- let userDimensionLock = false;
317
- let prevSelectedId: any = null;
318
- $: {
319
- const curId = selectedObject;
320
- if (curId !== prevSelectedId) {
321
- prevSelectedId = curId;
322
- // Read the flag on this object. dimensionLocked can still be the previous
323
- // selection's value in the same update, which left text looking unlocked.
324
- userDimensionLock = !!(curId as any)?._lockAspectRatio;
325
- }
326
- }
327
- $: effectiveDimensionLock = forcedLock || userDimensionLock;
328
-
329
- function handleWidthInput(e: Event) {
330
- const input = e.target as HTMLInputElement;
331
- const newWidth = Math.max(1, parseInt(input.value, 10) || 1);
332
- if (effectiveDimensionLock && displayWidth > 0) {
333
- const ratio = newWidth / displayWidth;
334
- const newHeight = Math.round(displayHeight * ratio);
335
- onWidthChange(newWidth);
336
- onHeightChange(newHeight);
337
- } else {
338
- onWidthChange(newWidth);
339
- }
340
- }
341
-
342
- function handleHeightInput(e: Event) {
343
- const input = e.target as HTMLInputElement;
344
- const newHeight = Math.max(1, parseInt(input.value, 10) || 1);
345
- if (effectiveDimensionLock && displayHeight > 0) {
346
- const ratio = newHeight / displayHeight;
347
- const newWidth = Math.round(displayWidth * ratio);
348
- onHeightChange(newHeight);
349
- onWidthChange(newWidth);
350
- } else {
351
- onHeightChange(newHeight);
352
- }
353
- }
354
-
355
- function toggleDimensionLock() {
356
- if (forcedLock) return;
357
- userDimensionLock = !userDimensionLock;
358
- if (selectedObject) {
359
- (selectedObject as any)._lockAspectRatio = userDimensionLock;
360
- // Text keeps its side handles. The lock only decides whether a resize may stretch the letters.
361
- if (selectedObject.type !== 'textbox') {
362
- if (userDimensionLock) {
363
- selectedObject.setControlsVisibility?.({ ml: false, mr: false, mt: false, mb: false });
364
- } else {
365
- selectedObject.setControlsVisibility?.({ ml: true, mr: true, mt: true, mb: true });
366
- }
367
- }
368
- selectedObject.canvas?.requestRenderAll?.();
369
- }
370
- }
371
-
372
- // Dismissal belongs to this selection, not to property-change notifications.
373
- // selectedObject is `any`, so these mirror it.
374
- let dismissedSelection: any = null;
375
- let previousSelection: any = null;
376
- $: if (selectedObject !== previousSelection) {
377
- previousSelection = selectedObject;
378
- dismissedSelection = null;
379
- }
380
- $: panelHidden = !selectedObject || dismissedSelection === selectedObject;
381
-
382
- function dismissPanel() {
383
- dismissedSelection = selectedObject;
384
- // Return keyboard focus to the canvas without discarding its selection.
385
- selectedObject?.canvas?.upperCanvasEl?.focus({ preventScroll: true });
386
- }
387
-
388
- // Panel minimize/maximize state: minimized shows only essential props
389
- let isMinimized = true;
390
-
391
- // Overlay-scrollbar: negative right margin = parent's horizontal padding so the
392
- // scrollbar sits on top of content rather than pushing it inward.
393
- // Only applied when the container actually overflows (needs scrolling).
394
- let needsScroll = false;
395
- let scrollableEl: HTMLElement | undefined;
396
- const panelPaddingX = 12; // must match px-3 (12px) on .props-panel-el
397
-
398
- function checkOverflow() {
399
- if (!scrollableEl) return;
400
- needsScroll = scrollableEl.scrollHeight > scrollableEl.clientHeight;
401
- }
402
-
403
- /** Svelte action: watches the scrollable container for overflow changes. */
404
- function overlayScrollbar(node: HTMLElement) {
405
- scrollableEl = node;
406
- const ro = new ResizeObserver(checkOverflow);
407
- ro.observe(node);
408
- checkOverflow();
409
- return { destroy() { ro.disconnect(); } };
410
- }
411
-
412
- // Re-check when selected object or minimized state changes (DOM may reflow)
413
- $: selectedObject, isMinimized, setTimeout(checkOverflow, 50);
414
- </script>
415
-
416
- <div class="{className ? className + ' ' : ''}props-panel-el relative px-3 py-3 {panelHidden ? 'invisible pointer-events-none' : ''}" aria-hidden={panelHidden} inert={panelHidden} style={style}>
417
-
418
- <!-- Sticky Header: Selected Object Type + Children count + minimize toggle -->
419
- <div class="props-panel-sticky-header">
420
- <div class="header">
421
- <span class="header-label">{$t('canvas.props.shape')}</span>
422
- <span class="header-type" title={displayType}>{displayType}</span>
423
- <Tooltip text={$t(isMinimized ? 'canvas.props.showAll' : 'canvas.props.showFewer')}>
424
- <button
425
- class="minimize-toggle-bt"
426
- onclick={() => isMinimized = !isMinimized}
427
- aria-label={$t(isMinimized ? 'canvas.props.showAll' : 'canvas.props.showFewer')}
428
- >
429
- {#if isMinimized}
430
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
431
- <polyline points="6 9 12 15 18 9"/>
432
- </svg>
433
- {:else}
434
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
435
- <polyline points="18 15 12 9 6 15"/>
436
- </svg>
437
- {/if}
438
- </button>
439
- </Tooltip>
440
- </div>
441
-
442
- <button
443
- type="button"
444
- class="props-panel-close-button absolute end-0 top-0 flex h-5 w-5 items-center justify-center rounded text-grey5 hover:bg-grey2 hover:text-dark focus:outline-none focus:shadow-none focus-visible:bg-grey2 focus-visible:text-dark focus-visible:outline-none focus-visible:shadow-none"
445
- aria-label={$t('canvas.props.close')}
446
- title={$t('canvas.props.close')}
447
- onclick={dismissPanel}
448
- >
449
- <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="m6 6 12 12M18 6 6 18" /></svg>
450
- </button>
451
-
452
- <!-- Children count: shown for frames, groups, and multi-selections -->
453
- {#if childrenCount !== null}
454
- <div class="children-count-row">
455
- <svg class="children-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
456
- <rect x="2" y="7" width="8" height="8" rx="1"/>
457
- <rect x="14" y="3" width="8" height="8" rx="1"/>
458
- <rect x="14" y="13" width="8" height="8" rx="1"/>
459
- <line x1="10" y1="11" x2="14" y2="7"/>
460
- <line x1="10" y1="11" x2="14" y2="17"/>
461
- </svg>
462
- <span class="prop-label">{$t('canvas.props.children', { count: String(childrenCount) })}</span>
463
- </div>
464
- {/if}
465
- </div>
466
-
467
- <!-- Scrollable content: all property sections -->
468
- <div class="props-panel-scrollable" use:overlayScrollbar style={needsScroll ? `margin-inline-end: -${panelPaddingX}px` : ''}>
469
- <div class="props-panel-scrollable-content flex flex-col gap-4">
470
- <!-- Actions section: Capture, Convert to Widget, Layer Order (first section, no top border) -->
471
- {#if onCapture || onConvertToWidget || selectedObject}
472
- <div class="section-divider no-top-border">
473
- <span class="section-title">{$t('canvas.props.actions')}</span>
474
- </div>
475
- {#if onCapture && !(onConvertToWidget && selectedObject)}
476
- <div class="prop-section">
477
- <span class="prop-label">{$t('canvas.widget.createPreview')}</span>
478
- <div class="capture-section">
479
- <button class="capture-btn" onclick={onCapture}>
480
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
481
- <rect x="3" y="3" width="18" height="18" rx="2" ry="2"/>
482
- <circle cx="8.5" cy="8.5" r="1.5"/>
483
- <polyline points="21 15 16 10 5 21"/>
484
- </svg>
485
- {$t('canvas.widget.capture')}
486
- </button>
487
- </div>
488
- </div>
489
- {/if}
490
- {#if onConvertToWidget && selectedObject}
491
- <div class="prop-section">
492
- {#if showWidgetLoader}
493
- <!-- Loading state: duplicate/convert in progress -->
494
- <span class="prop-label">{$t('canvas.widget.linked')}</span>
495
- <div class="widget-linking-loader">
496
- <div class="widget-linking-spinner"></div>
497
- <span class="widget-linking-text">{$t(isConverting ? 'canvas.widget.converting' : isDuplicating ? 'canvas.widget.duplicating' : 'canvas.widget.linking')}</span>
498
- </div>
499
- {:else if hasWidgetId}
500
- {#if isOrphanedWidgetShape}
501
- <span class="prop-label">{$t('canvas.widget.unlinkedTitle')}</span>
502
- <p class="widget-orphan-notice">
503
- {$t('canvas.widget.orphanNotice')}
504
- </p>
505
- <span class="widget-id-label" title={widgetId}>{widgetId}</span>
506
- {#if onRemoveOrphanedShape}
507
- <button
508
- class="remove-orphan-btn"
509
- type="button"
510
- onclick={() => onRemoveOrphanedShape?.()}
511
- >
512
- {$t('canvas.widget.removeFromCanvas')}
513
- </button>
514
- {/if}
515
- {:else}
516
- <span class="prop-label">{$t('canvas.widget.linked')}</span>
517
- <div class="widget-linked-section">
518
- <input
519
- class="widget-rename-input"
520
- type="text"
521
- value={resolvedWidgetName || ''}
522
- placeholder={$t('canvas.widget.namePlaceholder')}
523
- onfocus={(e) => { widgetRenameValue = e.currentTarget.value; }}
524
- onblur={(e) => {
525
- const val = e.currentTarget.value.trim();
526
- if (val && val !== resolvedWidgetName && onWidgetRename && widgetId) {
527
- onWidgetRename(widgetId, val);
528
- }
529
- }}
530
- onkeydown={(e) => {
531
- if (e.key === 'Enter') { e.currentTarget.blur(); }
532
- if (e.key === 'Escape') { e.currentTarget.value = resolvedWidgetName || ''; e.currentTarget.blur(); }
533
- }}
534
- />
535
- </div>
536
- <!-- svelte-ignore a11y_click_events_have_key_events -->
537
- <!-- svelte-ignore a11y_no_static_element_interactions -->
538
- <span
539
- class="widget-id-label"
540
- class:widget-id-clickable={!!onWidgetClick}
541
- onclick={() => onWidgetClick && widgetId && onWidgetClick(widgetId)}
542
- title={onWidgetClick ? $t('canvas.widget.openDetails') : widgetId}
543
- >
544
- {#if onWidgetClick}
545
- <svg class="widget-id-link-icon" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
546
- <path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/>
547
- <path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/>
548
- </svg>
549
- {/if}
550
- {widgetId}
551
- </span>
552
- {#if onRefreshScreenshot && widgetId}
553
- <button
554
- class="refresh-screenshot-btn"
555
- title={$t('canvas.widget.refreshPreview')}
556
- onclick={() => onRefreshScreenshot && widgetId && onRefreshScreenshot(widgetId)}
557
- >
558
- <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
559
- <polyline points="23 4 23 10 17 10"/>
560
- <polyline points="1 20 1 14 7 14"/>
561
- <path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/>
562
- </svg>
563
- {$t('canvas.widget.refreshPreview')}
564
- </button>
565
- {/if}
566
- {#if onSetAsPrimary && widgetId}
567
- {#if selectedObject?._isPrimaryWidget}
568
- <span class="primary-widget-badge">{$t('canvas.widget.primary')}</span>
569
- {:else}
570
- <button
571
- class="set-primary-btn"
572
- type="button"
573
- title={$t('canvas.widget.primaryTitle')}
574
- onclick={() => onSetAsPrimary && widgetId && onSetAsPrimary(widgetId)}
575
- >
576
- {$t('canvas.widget.setPrimary')}
577
- </button>
578
- {/if}
579
- {/if}
580
- {/if}
581
- {:else}
582
- <span class="prop-label">{$t('canvas.widget.convertLabel')}</span>
583
- <div class="capture-section">
584
- <button class="convert-widget-btn" onclick={onConvertToWidget}>
585
- <svg class="convert-widget-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
586
- <rect x="2" y="2" width="20" height="20" rx="2.18" ry="2.18"/>
587
- <line x1="7" y1="2" x2="7" y2="22"/>
588
- <line x1="17" y1="2" x2="17" y2="22"/>
589
- <line x1="2" y1="12" x2="22" y2="12"/>
590
- </svg>
591
- {$t('canvas.widget.convertButton')}
592
- </button>
593
- </div>
594
- {/if}
595
- </div>
596
- {/if}
597
- {#if selectedObject && !isMinimized}
598
- <div class="prop-section layer-order-section">
599
- <span class="prop-label">{$t('canvas.layer.title')}</span>
600
- <div class="layer-order-buttons">
601
- <!-- svelte-ignore a11y-click-events-have-key-events -->
602
- <!-- svelte-ignore a11y-no-static-element-interactions -->
603
- <button class="layer-btn" onclick={onBringToFront} title={$t('canvas.layer.front')}>
604
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
605
- <polyline points="17 11 12 6 7 11"/>
606
- <polyline points="17 18 12 13 7 18"/>
607
- </svg>
608
- <span class="layer-btn-label">{$t('canvas.layer.frontShort')}</span>
609
- </button>
610
- <button class="layer-btn" onclick={onBringForward} title={$t('canvas.layer.forward')}>
611
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
612
- <polyline points="18 15 12 9 6 15"/>
613
- </svg>
614
- <span class="layer-btn-label">{$t('canvas.layer.upShort')}</span>
615
- </button>
616
- <button class="layer-btn" onclick={onSendBackward} title={$t('canvas.layer.backward')}>
617
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
618
- <polyline points="6 9 12 15 18 9"/>
619
- </svg>
620
- <span class="layer-btn-label">{$t('canvas.layer.downShort')}</span>
621
- </button>
622
- <button class="layer-btn" onclick={onSendToBack} title={$t('canvas.layer.back')}>
623
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
624
- <polyline points="7 13 12 18 17 13"/>
625
- <polyline points="7 6 12 11 17 6"/>
626
- </svg>
627
- <span class="layer-btn-label">{$t('canvas.layer.backShort')}</span>
628
- </button>
629
- </div>
630
- </div>
631
- {/if}
632
-
633
- <!-- Alignment: visible in both minimized and expanded modes -->
634
- {#if selectedObject}
635
- <div class="prop-section align-section">
636
- <span class="prop-label">{$t('canvas.arrange.title')}</span>
637
- <!-- The buttons draw a side of the board (left, centre, right, top ...), so they keep their order on every screen. -->
638
- <div class="align-buttons" dir="ltr">
639
- <button class="align-btn" onclick={onAlignLeft} title={$t('canvas.arrange.left')}>
640
- <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
641
- <rect x="3" y="4" width="2" height="16" rx="1"/>
642
- <rect x="7" y="7" width="10" height="4" rx="1"/>
643
- <rect x="7" y="13" width="14" height="4" rx="1"/>
644
- </svg>
645
- </button>
646
- <button class="align-btn" onclick={onAlignCenterH} title={$t('canvas.arrange.centerH')}>
647
- <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
648
- <rect x="11" y="3" width="2" height="18" rx="1"/>
649
- <rect x="5" y="7" width="14" height="4" rx="1"/>
650
- <rect x="8" y="13" width="8" height="4" rx="1"/>
651
- </svg>
652
- </button>
653
- <button class="align-btn" onclick={onAlignRight} title={$t('canvas.arrange.right')}>
654
- <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
655
- <rect x="19" y="4" width="2" height="16" rx="1"/>
656
- <rect x="7" y="7" width="10" height="4" rx="1"/>
657
- <rect x="3" y="13" width="14" height="4" rx="1"/>
658
- </svg>
659
- </button>
660
- <button class="align-btn" onclick={onAlignTop} title={$t('canvas.arrange.top')}>
661
- <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
662
- <rect x="4" y="3" width="16" height="2" rx="1"/>
663
- <rect x="7" y="7" width="4" height="10" rx="1"/>
664
- <rect x="13" y="7" width="4" height="14" rx="1"/>
665
- </svg>
666
- </button>
667
- <button class="align-btn" onclick={onAlignMiddleV} title={$t('canvas.arrange.middleV')}>
668
- <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
669
- <rect x="3" y="11" width="18" height="2" rx="1"/>
670
- <rect x="7" y="5" width="4" height="14" rx="1"/>
671
- <rect x="13" y="8" width="4" height="8" rx="1"/>
672
- </svg>
673
- </button>
674
- <button class="align-btn" onclick={onAlignBottom} title={$t('canvas.arrange.bottom')}>
675
- <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
676
- <rect x="4" y="19" width="16" height="2" rx="1"/>
677
- <rect x="7" y="7" width="4" height="10" rx="1"/>
678
- <rect x="13" y="3" width="4" height="14" rx="1"/>
679
- </svg>
680
- </button>
681
- </div>
682
- </div>
683
- {/if}
684
- {/if}
685
-
686
- <!-- ==================== IMAGE SOURCE (always visible for image shapes, even in reduced mode) ==================== -->
687
- {#if !isWidgetImage && (isImagePlaceholder || hasLoadedImage)}
688
- <div class="prop-section image-source-section">
689
- <span class="section-title-inline">{$t('canvas.image.source')}</span>
690
- <!-- File source option -->
691
- <div class="source-row">
692
- <span class="source-label">{$t('canvas.image.file')}</span>
693
- {#if hasLoadedImage && imageFilename && !imageUrl}
694
- <span class="source-value" title={imageFilename}>{imageFilename}</span>
695
- {:else if isImagePlaceholder}
696
- <span class="source-placeholder">{$t('canvas.image.noFile')}</span>
697
- {:else}
698
- <span class="source-placeholder">-</span>
699
- {/if}
700
- </div>
701
- <button class="source-btn" onclick={onImageSourceChange}>
702
- {$t(hasLoadedImage ? 'canvas.image.changeFile' : 'canvas.image.chooseFile')}
703
- </button>
704
-
705
- <!-- URL source option -->
706
- <div class="source-row url-row">
707
- <span class="source-label">{$t('canvas.image.url')}</span>
708
- {#if hasLoadedImage && imageUrl}
709
- <span class="source-value url" title={imageUrl}>{imageUrl}</span>
710
- {:else}
711
- <div class="url-input-row">
712
- <input
713
- type="text"
714
- class="url-input"
715
- placeholder={$t('canvas.image.pasteUrl')}
716
- bind:value={imageUrlInput}
717
- onkeydown={(e) => {
718
- if (e.key === 'Enter' && imageUrlInput.trim()) {
719
- onImageUrlLoad(imageUrlInput.trim());
720
- imageUrlInput = '';
721
- }
722
- }}
723
- />
724
- <button
725
- class="url-load-btn"
726
- onclick={() => {
727
- if (imageUrlInput.trim()) {
728
- onImageUrlLoad(imageUrlInput.trim());
729
- imageUrlInput = '';
730
- }
731
- }}
732
- >
733
- {$t('canvas.image.load')}
734
- </button>
735
- </div>
736
- {/if}
737
- </div>
738
- {#if hasLoadedImage && imageUrl}
739
- <div class="url-input-row">
740
- <input
741
- type="text"
742
- class="url-input"
743
- placeholder={$t('canvas.image.newUrl')}
744
- bind:value={imageUrlInput}
745
- onkeydown={(e) => {
746
- if (e.key === 'Enter' && imageUrlInput.trim()) {
747
- onImageUrlLoad(imageUrlInput.trim());
748
- imageUrlInput = '';
749
- }
750
- }}
751
- />
752
- <button
753
- class="url-load-btn"
754
- onclick={() => {
755
- if (imageUrlInput.trim()) {
756
- onImageUrlLoad(imageUrlInput.trim());
757
- imageUrlInput = '';
758
- }
759
- }}
760
- >
761
- {$t('canvas.image.load')}
762
- </button>
763
- </div>
764
- {/if}
765
- </div>
766
- {/if}
767
-
768
- <!-- ==================== GENERAL PROPERTIES (all objects) ==================== -->
769
- <div class="section-divider">
770
- <span class="section-title">{$t('canvas.props.general')}</span>
771
- </div>
772
-
773
- <!-- Dimensions: width × height in real canvas pixels -->
774
- <div class="prop-section dimensions-section">
775
- <span class="prop-label dimensions-label">{$t('canvas.props.dimensions')}</span>
776
- <div class="dimensions-row">
777
- <input
778
- class="dimension-input"
779
- type="number"
780
- min="1"
781
- value={displayWidth}
782
- oninput={handleWidthInput}
783
- aria-label={$t('canvas.props.width')}
784
- />
785
- <!-- Lock / unlock button between inputs -->
786
- <Tooltip text={$t(forcedLock ? 'canvas.props.proportionsFixed' : effectiveDimensionLock ? 'canvas.props.proportionsUnlock' : 'canvas.props.proportionsLock')}>
787
- <!-- svelte-ignore a11y-click-events-have-key-events -->
788
- <!-- svelte-ignore a11y-no-static-element-interactions -->
789
- <span
790
- class="dimension-lock-bt {effectiveDimensionLock ? 'locked' : 'unlocked'} {forcedLock ? 'force-locked' : ''}"
791
- onclick={toggleDimensionLock}
792
- >
793
- {#if effectiveDimensionLock}
794
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
795
- <rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/>
796
- </svg>
797
- {:else}
798
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
799
- <rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 9.9-1"/>
800
- </svg>
801
- {/if}
802
- </span>
803
- </Tooltip>
804
- <input
805
- class="dimension-input"
806
- type="number"
807
- min="1"
808
- value={displayHeight}
809
- oninput={handleHeightInput}
810
- aria-label={$t('canvas.props.height')}
811
- />
812
- <span class="dimension-unit">px</span>
813
- </div>
814
- </div>
815
-
816
- <!-- Opacity: always visible, including wireframe mode.
817
- Useful for hiding/showing objects without deleting them. -->
818
- <div class="prop-section">
819
- <SliderUnitIC
820
- label={$t('canvas.field.opacity')}
821
- value={currentOpacity}
822
- min={0}
823
- max={100}
824
- step={1}
825
- unit="%"
826
- onChange={onOpacityChange}
827
- />
828
- </div>
829
-
830
- <!-- Corner Roundness: in General Properties, visible even when minimized -->
831
- {#if !isWidgetImage && (isRect || isTriangle || isPath || isImagePlaceholder || hasLoadedImage || isTextbox || isFrame || isMultiSelect || isLibraryShape)}
832
- <SliderUnitIC
833
- label={$t('canvas.field.cornerRoundness')}
834
- value={isTriangle ? currentTriangleRoundness : currentRoundness}
835
- min={0}
836
- max={100}
837
- step={1}
838
- unit="%"
839
- onChange={onRoundnessChange}
840
- />
841
- {/if}
842
-
843
- <!-- ==================== WIDGET BACKGROUND COLOR (visible behind transparent widget areas) ==================== -->
844
- {#if isWidgetImage}
845
- {#if wireframeMode || !isMinimized}
846
- <div class="prop-section widget-bg-section">
847
- <ColorIC
848
- label={$t('canvas.field.backgroundColor')}
849
- value={currentBackgroundColor === 'transparent' ? '#FFFFFF' : currentBackgroundColor}
850
- onChange={onBackgroundColorChange}
851
- showPicker={!wireframeMode}
852
- presets={wireframeMode ? wireframeColorValues : null}
853
- />
854
- </div>
855
- {/if}
856
- <SliderUnitIC
857
- label={$t('canvas.field.backgroundOpacity')}
858
- value={currentBackgroundOpacity}
859
- min={0}
860
- max={100}
861
- step={1}
862
- unit="%"
863
- onChange={onBackgroundOpacityChange}
864
- />
865
- {/if}
866
-
867
- <!-- ==================== TEXTBOX BOX PROPERTIES (in General Properties) ==================== -->
868
- {#if isTextbox}
869
- {#if !wireframeMode}
870
- <ColorIC
871
- label={$t('canvas.field.fillColor')}
872
- value={!textboxBoxFill || textboxBoxFill === 'transparent' ? '#FFFFFF' : textboxBoxFill}
873
- onChange={onTextboxBoxFillChange}
874
- />
875
- {/if}
876
-
877
- <SliderUnitIC
878
- label={$t('canvas.field.fillOpacity')}
879
- value={textboxBoxFillOpacity}
880
- min={0}
881
- max={100}
882
- step={1}
883
- unit="%"
884
- onChange={onFillOpacityChange}
885
- />
886
-
887
- {#if !wireframeMode}
888
- <ColorIC
889
- label={$t('canvas.field.strokeColor')}
890
- value={textboxBoxStroke || '#000000'}
891
- onChange={onTextboxBoxStrokeChange}
892
- />
893
- {/if}
894
-
895
- <SliderUnitIC
896
- label={$t('canvas.field.strokeWidth')}
897
- value={textboxBoxStrokeWidth}
898
- min={0}
899
- max={5}
900
- step={0.5}
901
- unit="px"
902
- onChange={onTextboxBoxStrokeWidthChange}
903
- />
904
-
905
- {#if !isMinimized}
906
- <div class="prop-section">
907
- <span class="prop-label">{$t('canvas.field.strokeType')}</span>
908
- <div class="stroke-type-buttons">
909
- <button
910
- class="stroke-type-btn {textboxBoxStrokeType === 'solid' ? 'active' : ''}"
911
- onclick={() => onTextboxBoxStrokeTypeChange('solid')}
912
- >
913
- <span class="stroke-preview solid"></span>
914
- {$t('canvas.field.strokeSolid')}
915
- </button>
916
- <button
917
- class="stroke-type-btn {textboxBoxStrokeType === 'dashed' ? 'active' : ''}"
918
- onclick={() => onTextboxBoxStrokeTypeChange('dashed')}
919
- >
920
- <span class="stroke-preview dashed"></span>
921
- {$t('canvas.field.strokeDashed')}
922
- </button>
923
- <button
924
- class="stroke-type-btn {textboxBoxStrokeType === 'dotted' ? 'active' : ''}"
925
- onclick={() => onTextboxBoxStrokeTypeChange('dotted')}
926
- >
927
- <span class="stroke-preview dotted"></span>
928
- {$t('canvas.field.strokeDotted')}
929
- </button>
930
- </div>
931
- </div>
932
- {/if}
933
- {/if}
934
-
935
- <!-- ==================== TEXT PROPERTIES ==================== -->
936
- {#if isTextbox}
937
- <div class="section-divider">
938
- <span class="section-title">{$t('canvas.props.textProperties')}</span>
939
- </div>
940
-
941
- <SliderUnitIC
942
- label={$t('canvas.field.fontSize')}
943
- value={currentFontSize}
944
- min={8}
945
- max={200}
946
- step={1}
947
- unit="px"
948
- onChange={onFontSizeChange}
949
- />
950
-
951
- <SliderUnitIC
952
- label={$t('canvas.field.textPadding')}
953
- value={currentTextPadding}
954
- min={0}
955
- max={50}
956
- step={1}
957
- unit="px"
958
- onChange={onTextPaddingChange}
959
- />
960
-
961
- {#if !wireframeMode}
962
- <ColorIC
963
- label={$t('canvas.field.textColor')}
964
- value={currentFill || '#000000'}
965
- onChange={onTextColorChange}
966
- />
967
-
968
- <!-- Text Stroke Properties -->
969
- <ColorIC
970
- label={$t('canvas.field.textStrokeColor')}
971
- value={textStrokeColor || '#000000'}
972
- onChange={onTextStrokeColorChange}
973
- />
974
- {/if}
975
-
976
- <SliderUnitIC
977
- label={$t('canvas.field.textStrokeWidth')}
978
- value={textStrokeWidth}
979
- min={0}
980
- max={5}
981
- step={0.5}
982
- unit="px"
983
- onChange={onTextStrokeWidthChange}
984
- />
985
-
986
- {#if !isMinimized}
987
- <FontSelectorIC
988
- value={currentFontFamily}
989
- onChange={onFontFamilyChange}
990
- />
991
-
992
- <TextStyleIC
993
- fontWeight={currentFontWeight}
994
- fontStyle={currentFontStyle}
995
- underline={currentUnderline}
996
- onFontWeightChange={onFontWeightChange}
997
- onFontStyleChange={onFontStyleChange}
998
- onUnderlineChange={onUnderlineChange}
999
- />
1000
-
1001
- <TextAlignIC
1002
- value={currentTextAlign}
1003
- onChange={onTextAlignChange}
1004
- />
1005
- {/if}
1006
- {/if}
1007
-
1008
- <!-- ==================== FRAME: Text / Description (always visible for frames) ==================== -->
1009
- {#if isFrame}
1010
- <div class="section-divider">
1011
- <span class="section-title">{$t('canvas.props.labelProperties')}</span>
1012
- </div>
1013
-
1014
- <div class="prop-section">
1015
- <span class="prop-label">{$t('canvas.props.labelText')}</span>
1016
- <input
1017
- type="text"
1018
- value={currentFrameLabel}
1019
- oninput={handleFrameLabelInput}
1020
- class="text-input"
1021
- placeholder={$t('canvas.props.labelPlaceholder')}
1022
- />
1023
- </div>
1024
- {/if}
1025
-
1026
- <!-- ==================== FRAME: Label styling (expanded only) ==================== -->
1027
- {#if !isMinimized && isFrame}
1028
- <SliderUnitIC
1029
- label={$t('canvas.field.fontSize')}
1030
- value={frameLabelFontSize}
1031
- min={8}
1032
- max={72}
1033
- step={1}
1034
- unit="px"
1035
- onChange={onFrameLabelFontSizeChange}
1036
- />
1037
-
1038
- <FontSelectorIC
1039
- value={frameLabelFontFamily}
1040
- onChange={onFrameLabelFontFamilyChange}
1041
- />
1042
-
1043
- <TextStyleIC
1044
- fontWeight={frameLabelFontWeight}
1045
- fontStyle={frameLabelFontStyle}
1046
- underline={frameLabelUnderline}
1047
- onFontWeightChange={onFrameLabelFontWeightChange}
1048
- onFontStyleChange={onFrameLabelFontStyleChange}
1049
- onUnderlineChange={onFrameLabelUnderlineChange}
1050
- />
1051
-
1052
- <TextAlignIC
1053
- value={frameLabelTextAlign}
1054
- onChange={onFrameLabelTextAlignChange}
1055
- />
1056
-
1057
- {#if !wireframeMode}
1058
- <ColorIC
1059
- label={$t('canvas.field.textColor')}
1060
- value={frameLabelTextColor}
1061
- onChange={onFrameLabelTextColorChange}
1062
- />
1063
-
1064
- <ColorIC
1065
- label={$t('canvas.props.textBackground')}
1066
- value={frameLabelBackgroundColor}
1067
- onChange={onFrameLabelBackgroundColorChange}
1068
- />
1069
- {/if}
1070
-
1071
- <div class="section-divider">
1072
- <span class="section-title">{$t('canvas.props.boxProperties')}</span>
1073
- </div>
1074
-
1075
- {/if}
1076
-
1077
- <!-- ==================== FILL COLOR (shapes only, not path/text/arrow/image, or multi-select) ==================== -->
1078
- {#if !isWidgetImage && ((hasFill && !isTextbox && !isImage) || isMultiSelect)}
1079
- {#if wireframeMode || !isMinimized}
1080
- <div class="prop-section">
1081
- <ColorIC
1082
- label={$t('canvas.field.fillColor')}
1083
- value={currentFill || '#FFFFFF'}
1084
- onChange={onFillChange}
1085
- showPicker={!wireframeMode}
1086
- presets={wireframeMode ? wireframeColorValues : null}
1087
- />
1088
- </div>
1089
- {/if}
1090
-
1091
- <!-- Fill Opacity stays visible even when minimized -->
1092
- <SliderUnitIC
1093
- label={$t('canvas.field.fillOpacity')}
1094
- value={currentFillOpacity}
1095
- min={0}
1096
- max={100}
1097
- step={1}
1098
- unit="%"
1099
- onChange={onFillOpacityChange}
1100
- />
1101
- {/if}
1102
-
1103
- <!-- ==================== STROKE PROPERTIES ==================== -->
1104
- {#if !isWidgetImage && ((hasStroke && !isTextbox) || isMultiSelect)}
1105
- {#if wireframeMode || !isMinimized}
1106
- <div class="prop-section">
1107
- <ColorIC
1108
- label={$t('canvas.field.strokeColor')}
1109
- value={currentStroke || '#000000'}
1110
- onChange={onStrokeChange}
1111
- showPicker={!wireframeMode}
1112
- presets={wireframeMode ? wireframeColorValues : null}
1113
- />
1114
- </div>
1115
- {/if}
1116
-
1117
- <!-- Stroke Width stays visible even when minimized -->
1118
- <SliderUnitIC
1119
- label={$t('canvas.field.strokeWidth')}
1120
- value={currentStrokeWidth}
1121
- min={0}
1122
- max={20}
1123
- step={1}
1124
- unit="px"
1125
- onChange={onStrokeWidthChange}
1126
- />
1127
-
1128
- {#if !isMinimized}
1129
- <div class="prop-section">
1130
- <span class="prop-label">{$t('canvas.field.strokeType')}</span>
1131
- <div class="stroke-type-buttons">
1132
- <button
1133
- class="stroke-type-btn {currentStrokeType === 'solid' ? 'active' : ''}"
1134
- onclick={() => onStrokeTypeChange('solid')}
1135
- >
1136
- <span class="stroke-preview solid"></span>
1137
- {$t('canvas.field.strokeSolid')}
1138
- </button>
1139
- <button
1140
- class="stroke-type-btn {currentStrokeType === 'dashed' ? 'active' : ''}"
1141
- onclick={() => onStrokeTypeChange('dashed')}
1142
- >
1143
- <span class="stroke-preview dashed"></span>
1144
- {$t('canvas.field.strokeDashed')}
1145
- </button>
1146
- <button
1147
- class="stroke-type-btn {currentStrokeType === 'dotted' ? 'active' : ''}"
1148
- onclick={() => onStrokeTypeChange('dotted')}
1149
- >
1150
- <span class="stroke-preview dotted"></span>
1151
- {$t('canvas.field.strokeDotted')}
1152
- </button>
1153
- </div>
1154
- </div>
1155
- {/if}
1156
- {/if}
1157
-
1158
- <!-- ==================== GROUP BOX (chrome around children, like Frame) ==================== -->
1159
- {#if isPlainGroup && !isWidgetImage}
1160
- <div class="section-divider">
1161
- <span class="section-title">{$t('canvas.props.groupBox')}</span>
1162
- </div>
1163
- {#if wireframeMode || !isMinimized}
1164
- <div class="prop-section">
1165
- <ColorIC
1166
- label={$t('canvas.field.groupFillColor')}
1167
- value={groupFill || '#FFFFFF'}
1168
- onChange={onGroupFillChange}
1169
- showPicker={!wireframeMode}
1170
- presets={wireframeMode ? wireframeColorValues : null}
1171
- />
1172
- </div>
1173
- {/if}
1174
- <SliderUnitIC
1175
- label={$t('canvas.field.groupFillOpacity')}
1176
- value={groupFillOpacity}
1177
- min={0}
1178
- max={100}
1179
- step={1}
1180
- unit="%"
1181
- onChange={onGroupFillOpacityChange}
1182
- />
1183
- {#if wireframeMode || !isMinimized}
1184
- <div class="prop-section">
1185
- <ColorIC
1186
- label={$t('canvas.field.groupStrokeColor')}
1187
- value={groupStroke || '#000000'}
1188
- onChange={onGroupStrokeChange}
1189
- showPicker={!wireframeMode}
1190
- presets={wireframeMode ? wireframeColorValues : null}
1191
- />
1192
- </div>
1193
- {/if}
1194
- <SliderUnitIC
1195
- label={$t('canvas.field.groupStrokeWidth')}
1196
- value={groupStrokeWidth}
1197
- min={0}
1198
- max={20}
1199
- step={1}
1200
- unit="px"
1201
- onChange={onGroupStrokeWidthChange}
1202
- />
1203
- {#if !isMinimized}
1204
- <div class="prop-section">
1205
- <span class="prop-label">{$t('canvas.field.groupStrokeType')}</span>
1206
- <div class="stroke-type-buttons">
1207
- <button
1208
- class="stroke-type-btn {groupStrokeType === 'solid' ? 'active' : ''}"
1209
- onclick={() => onGroupStrokeTypeChange('solid')}
1210
- >
1211
- <span class="stroke-preview solid"></span>
1212
- {$t('canvas.field.strokeSolid')}
1213
- </button>
1214
- <button
1215
- class="stroke-type-btn {groupStrokeType === 'dashed' ? 'active' : ''}"
1216
- onclick={() => onGroupStrokeTypeChange('dashed')}
1217
- >
1218
- <span class="stroke-preview dashed"></span>
1219
- {$t('canvas.field.strokeDashed')}
1220
- </button>
1221
- <button
1222
- class="stroke-type-btn {groupStrokeType === 'dotted' ? 'active' : ''}"
1223
- onclick={() => onGroupStrokeTypeChange('dotted')}
1224
- >
1225
- <span class="stroke-preview dotted"></span>
1226
- {$t('canvas.field.strokeDotted')}
1227
- </button>
1228
- </div>
1229
- </div>
1230
- {/if}
1231
- {/if}
1232
-
1233
- <!-- ==================== TEXT PROPERTIES (for selection/group containing textboxes or frames) ==================== -->
1234
- {#if !isMinimized && hasTextboxInSelection}
1235
- <div class="section-divider">
1236
- <span class="section-title">{$t('canvas.props.textProperties')}</span>
1237
- </div>
1238
-
1239
- <SliderUnitIC
1240
- label={$t('canvas.field.fontSize')}
1241
- value={currentFontSize}
1242
- min={8}
1243
- max={200}
1244
- step={1}
1245
- unit="px"
1246
- onChange={onFontSizeChange}
1247
- />
1248
-
1249
- <FontSelectorIC
1250
- value={currentFontFamily}
1251
- onChange={onFontFamilyChange}
1252
- />
1253
-
1254
- <TextStyleIC
1255
- fontWeight={currentFontWeight}
1256
- fontStyle={currentFontStyle}
1257
- underline={currentUnderline}
1258
- onFontWeightChange={onFontWeightChange}
1259
- onFontStyleChange={onFontStyleChange}
1260
- onUnderlineChange={onUnderlineChange}
1261
- />
1262
-
1263
- <TextAlignIC
1264
- value={currentTextAlign}
1265
- onChange={onTextAlignChange}
1266
- />
1267
-
1268
- <SliderUnitIC
1269
- label={$t('canvas.field.textPadding')}
1270
- value={currentTextPadding}
1271
- min={0}
1272
- max={50}
1273
- step={1}
1274
- unit="px"
1275
- onChange={onTextPaddingChange}
1276
- />
1277
-
1278
- <ColorIC
1279
- label={$t('canvas.field.textColor')}
1280
- value={currentFill || '#000000'}
1281
- onChange={onTextColorChange}
1282
- />
1283
-
1284
- <!-- Text Stroke Properties for Selection/Group -->
1285
- <ColorIC
1286
- label={$t('canvas.field.textStrokeColor')}
1287
- value={textStrokeColor || '#000000'}
1288
- onChange={onTextStrokeColorChange}
1289
- />
1290
-
1291
- <SliderUnitIC
1292
- label={$t('canvas.field.textStrokeWidth')}
1293
- value={textStrokeWidth}
1294
- min={0}
1295
- max={5}
1296
- step={0.5}
1297
- unit="px"
1298
- onChange={onTextStrokeWidthChange}
1299
- />
1300
- {/if}
1301
- </div><!-- end props-panel-scrollable-content -->
1302
- </div><!-- end props-panel-scrollable -->
1303
- </div>
1304
-
1305
- <style>
1306
- .props-panel-el {
1307
- --accent: #314F2F;
1308
- --accent-hover: #1f3520;
1309
- --accent-light: rgba(49, 79, 47, 0.08);
1310
- width: 248px;
1311
- max-height: calc(100% - 80px);
1312
- overflow: hidden;
1313
- display: flex;
1314
- flex-direction: column;
1315
- border: 2px solid #e5e7eb;
1316
- position: absolute;
1317
- top: 8px;
1318
- inset-inline-end: 8px;
1319
- background: white;
1320
- border-radius: 8px;
1321
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
1322
- }
1323
-
1324
- .props-panel-el :global(button:focus),
1325
- .props-panel-el :global(button:focus-visible),
1326
- .props-panel-el :global(a:focus),
1327
- .props-panel-el :global(a:focus-visible),
1328
- .props-panel-el :global(input:focus),
1329
- .props-panel-el :global(input:focus-visible) {
1330
- outline: none !important;
1331
- box-shadow: none !important;
1332
- }
1333
-
1334
- /* Sticky header: stays at top, never scrolls */
1335
- .props-panel-sticky-header {
1336
- flex-shrink: 0;
1337
- display: flex;
1338
- flex-direction: column;
1339
- gap: 0;
1340
- padding-bottom: 0;
1341
- border-bottom: 2px solid #e5e7eb;
1342
- }
1343
-
1344
- /* Scrollable content area for all property sections.
1345
- margin-right is set dynamically via style= when content overflows,
1346
- pulling the scrollbar over the parent's right padding zone. */
1347
- .props-panel-scrollable {
1348
- flex: 1;
1349
- overflow-y: auto;
1350
- overflow-x: hidden;
1351
- display: flex;
1352
- flex-direction: column;
1353
- gap: 12px;
1354
- padding: 0;
1355
- scrollbar-width: thin;
1356
- scrollbar-color: rgba(0,0,0,0.15) transparent;
1357
- }
1358
- .props-panel-scrollable::-webkit-scrollbar {
1359
- width: 4px;
1360
- }
1361
- .props-panel-scrollable::-webkit-scrollbar-track {
1362
- background: transparent;
1363
- }
1364
- .props-panel-scrollable::-webkit-scrollbar-thumb {
1365
- background: rgba(0,0,0,0.15);
1366
- border-radius: 4px;
1367
- }
1368
- .props-panel-scrollable::-webkit-scrollbar-thumb:hover {
1369
- background: rgba(0,0,0,0.25);
1370
- }
1371
-
1372
- .header {
1373
- display: flex;
1374
- gap: 4px;
1375
- padding-bottom: 8px;
1376
- align-items: flex-end;
1377
- }
1378
-
1379
- .minimize-toggle-bt {
1380
- margin-inline-start: auto;
1381
- /* Clear the corner close button parked beside the panel edge. */
1382
- margin-inline-end: 0px;
1383
- margin-bottom: -2px;
1384
- display: flex;
1385
- align-items: center;
1386
- justify-content: center;
1387
- width: 18px;
1388
- height: 18px;
1389
- background: transparent;
1390
- border: 1px solid transparent;
1391
- border-radius: 4px;
1392
- cursor: pointer;
1393
- color: #6b7280;
1394
- padding: 0;
1395
- flex-shrink: 0;
1396
- transition: all 0.15s ease;
1397
- }
1398
- .minimize-toggle-bt:hover {
1399
- background: #f3f4f6;
1400
- border-color: #d1d5db;
1401
- color: #374151;
1402
- }
1403
-
1404
- .header-label {
1405
- font-size: 12px;
1406
- font-weight: 700;
1407
- color: #6b7280;
1408
- letter-spacing: 0.5px;
1409
- }
1410
-
1411
- .header-type {
1412
- font-size: 13px;
1413
- font-weight: 600;
1414
- color: #111827;
1415
- white-space: nowrap;
1416
- overflow: hidden;
1417
- text-overflow: ellipsis;
1418
- }
1419
-
1420
- .children-count-row {
1421
- display: flex;
1422
- align-items: center;
1423
- gap: 6px;
1424
- padding: 6px 0 8px 0;
1425
- border-top: 1px solid #e5e7eb;
1426
- }
1427
-
1428
- .children-icon {
1429
- color: #6b7280;
1430
- flex-shrink: 0;
1431
- }
1432
-
1433
- .capture-section {
1434
- display: flex;
1435
- justify-content: center;
1436
- }
1437
-
1438
- .layer-order-section {
1439
- padding: 4px 8px;
1440
- }
1441
-
1442
- .layer-order-buttons {
1443
- display: flex;
1444
- gap: 4px;
1445
- justify-content: center;
1446
- }
1447
-
1448
- .layer-btn {
1449
- display: flex;
1450
- flex-direction: column;
1451
- align-items: center;
1452
- gap: 2px;
1453
- padding: 6px 10px;
1454
- background: #f3f4f6;
1455
- border: 1px solid #d1d5db;
1456
- border-radius: 6px;
1457
- cursor: pointer;
1458
- color: #374151;
1459
- font-size: 10px;
1460
- line-height: 1;
1461
- transition: all 0.15s ease;
1462
- flex: 1;
1463
- }
1464
-
1465
- .layer-btn:hover {
1466
- background: #e5e7eb;
1467
- border-color: #9ca3af;
1468
- color: #111827;
1469
- }
1470
-
1471
- .layer-btn:active {
1472
- background: #d1d5db;
1473
- transform: scale(0.95);
1474
- }
1475
-
1476
- .layer-btn-label {
1477
- font-size: 9px;
1478
- font-weight: 500;
1479
- text-transform: uppercase;
1480
- letter-spacing: 0.3px;
1481
- }
1482
-
1483
- /* Alignment buttons */
1484
- .align-section {
1485
- padding: 4px 8px;
1486
- }
1487
-
1488
- .align-buttons {
1489
- display: flex;
1490
- gap: 3px;
1491
- justify-content: center;
1492
- }
1493
-
1494
- .align-btn {
1495
- display: flex;
1496
- align-items: center;
1497
- justify-content: center;
1498
- width: 30px;
1499
- height: 30px;
1500
- background: #f3f4f6;
1501
- border: 1px solid #d1d5db;
1502
- border-radius: 6px;
1503
- cursor: pointer;
1504
- color: #374151;
1505
- transition: all 0.15s ease;
1506
- flex: 1;
1507
- padding: 0;
1508
- }
1509
-
1510
- .align-btn:hover {
1511
- background: #e5e7eb;
1512
- border-color: #9ca3af;
1513
- color: #111827;
1514
- }
1515
-
1516
- .align-btn:active {
1517
- background: #d1d5db;
1518
- transform: scale(0.95);
1519
- }
1520
-
1521
- .capture-btn {
1522
- display: flex;
1523
- align-items: center;
1524
- gap: 6px;
1525
- padding: 8px 16px;
1526
- background: var(--accent);
1527
- color: white;
1528
- border: none;
1529
- border-radius: 6px;
1530
- font-size: 13px;
1531
- font-weight: 600;
1532
- cursor: pointer;
1533
- transition: all 0.2s ease;
1534
- box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
1535
- }
1536
-
1537
- .capture-btn:hover {
1538
- background: var(--accent-hover);
1539
- box-shadow: 0 4px 8px rgba(49, 79, 47, 0.4);
1540
- transform: translateY(-1px);
1541
- }
1542
-
1543
- .capture-btn:active {
1544
- transform: translateY(0);
1545
- box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
1546
- }
1547
-
1548
- .capture-btn svg {
1549
- width: 16px;
1550
- height: 16px;
1551
- }
1552
-
1553
- .convert-widget-btn {
1554
- display: flex;
1555
- align-items: center;
1556
- gap: 6px;
1557
- padding: 8px 16px;
1558
- background: var(--accent);
1559
- color: white;
1560
- border: none;
1561
- border-radius: 6px;
1562
- font-size: 13px;
1563
- font-weight: 600;
1564
- cursor: pointer;
1565
- transition: all 0.2s ease;
1566
- box-shadow: 0 2px 4px rgba(49, 79, 47, 0.3);
1567
- }
1568
-
1569
- .convert-widget-btn:hover {
1570
- background: var(--accent-hover);
1571
- box-shadow: 0 4px 8px rgba(49, 79, 47, 0.4);
1572
- transform: translateY(-1px);
1573
- }
1574
-
1575
- .convert-widget-btn:active {
1576
- transform: translateY(0);
1577
- box-shadow: 0 2px 4px rgba(49, 79, 47, 0.3);
1578
- }
1579
-
1580
- /* Host apps (site / DS) leak global svg fill/stroke; keep this icon white on the green button. */
1581
- .convert-widget-btn :global(svg),
1582
- .convert-widget-btn :global(svg *) {
1583
- width: 16px;
1584
- height: 16px;
1585
- color: #ffffff !important;
1586
- fill: none !important;
1587
- stroke: currentColor !important;
1588
- }
1589
-
1590
- .widget-linked-section {
1591
- display: flex;
1592
- align-items: center;
1593
- gap: 4px;
1594
- }
1595
- .widget-linking-loader {
1596
- display: flex;
1597
- align-items: center;
1598
- gap: 8px;
1599
- padding: 6px 8px;
1600
- border-radius: 6px;
1601
- background: #f0fdf4;
1602
- border: 1px solid #bbf7d0;
1603
- }
1604
- .widget-linking-spinner {
1605
- width: 14px;
1606
- height: 14px;
1607
- border: 2px solid #bbf7d0;
1608
- border-top-color: #166534;
1609
- border-radius: 50%;
1610
- animation: widget-spin 0.6s linear infinite;
1611
- flex-shrink: 0;
1612
- }
1613
- @keyframes widget-spin {
1614
- to { transform: rotate(360deg); }
1615
- }
1616
- .widget-linking-text {
1617
- font-size: 11px;
1618
- color: #166534;
1619
- font-weight: 500;
1620
- }
1621
-
1622
- .widget-linked-badge {
1623
- display: flex;
1624
- align-items: center;
1625
- gap: 6px;
1626
- padding: 6px 12px;
1627
- background: #f0fdf4;
1628
- border: 1px solid #86efac;
1629
- border-radius: 6px;
1630
- font-size: 12px;
1631
- font-weight: 500;
1632
- color: #166534;
1633
- overflow: hidden;
1634
- text-overflow: ellipsis;
1635
- white-space: nowrap;
1636
- max-width: 100%;
1637
- }
1638
-
1639
- .widget-linked-badge svg {
1640
- flex-shrink: 0;
1641
- width: 14px;
1642
- height: 14px;
1643
- stroke: #166534;
1644
- }
1645
-
1646
- .widget-rename-input {
1647
- width: 100%;
1648
- padding: 5px 8px;
1649
- border: 1px solid #d1d5db;
1650
- border-radius: 6px;
1651
- font-size: 12px;
1652
- font-weight: 500;
1653
- color: #166534;
1654
- background: #f9fafb;
1655
- outline: none;
1656
- min-width: 0;
1657
- }
1658
- .widget-rename-input:focus {
1659
- border-color: #86efac;
1660
- background: #f0fdf4;
1661
- box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.2);
1662
- }
1663
-
1664
- .widget-id-label {
1665
- display: flex;
1666
- align-items: center;
1667
- gap: 4px;
1668
- font-size: 11px;
1669
- color: #9ca3af;
1670
- overflow: hidden;
1671
- text-overflow: ellipsis;
1672
- white-space: nowrap;
1673
- margin-top: 2px;
1674
- padding: 1px 2px;
1675
- border-radius: 3px;
1676
- transition: background-color 0.15s, color 0.15s;
1677
- }
1678
- .widget-id-clickable {
1679
- cursor: pointer;
1680
- color: #166534;
1681
- }
1682
- .widget-id-clickable:hover {
1683
- color: #15803d;
1684
- background-color: #dcfce7;
1685
- }
1686
- :global(.widget-id-link-icon) {
1687
- flex-shrink: 0;
1688
- }
1689
-
1690
- .refresh-screenshot-btn {
1691
- display: flex;
1692
- align-items: center;
1693
- gap: 5px;
1694
- margin-top: 4px;
1695
- padding: 3px 8px;
1696
- font-size: 11px;
1697
- font-weight: 500;
1698
- color: #6b7280;
1699
- background: #f3f4f6;
1700
- border: 1px solid #e5e7eb;
1701
- border-radius: 4px;
1702
- cursor: pointer;
1703
- transition: all 0.15s;
1704
- width: 100%;
1705
- box-sizing: border-box;
1706
- justify-content: center;
1707
- }
1708
- .refresh-screenshot-btn:hover {
1709
- color: #166534;
1710
- background: #dcfce7;
1711
- border-color: #86efac;
1712
- }
1713
- .refresh-screenshot-btn:active {
1714
- transform: scale(0.97);
1715
- }
1716
- .refresh-screenshot-btn svg {
1717
- flex-shrink: 0;
1718
- }
1719
-
1720
- .set-primary-btn {
1721
- display: flex;
1722
- align-items: center;
1723
- margin-top: 4px;
1724
- padding: 3px 8px;
1725
- font-size: 11px;
1726
- font-weight: 500;
1727
- color: #991b1b;
1728
- background: #fef2f2;
1729
- border: 1px solid #fecaca;
1730
- border-radius: 4px;
1731
- cursor: pointer;
1732
- width: 100%;
1733
- box-sizing: border-box;
1734
- justify-content: center;
1735
- }
1736
- .set-primary-btn:hover {
1737
- background: #fee2e2;
1738
- border-color: #f87171;
1739
- }
1740
- .primary-widget-badge {
1741
- display: flex;
1742
- align-items: center;
1743
- justify-content: center;
1744
- margin-top: 4px;
1745
- padding: 3px 8px;
1746
- font-size: 11px;
1747
- font-weight: 600;
1748
- color: #991b1b;
1749
- background: #fef2f2;
1750
- border: 1px solid #fecaca;
1751
- border-radius: 4px;
1752
- width: 100%;
1753
- box-sizing: border-box;
1754
- text-align: center;
1755
- }
1756
-
1757
- .widget-orphan-notice {
1758
- font-size: 11px;
1759
- line-height: 1.45;
1760
- color: #b45309;
1761
- background: #fffbeb;
1762
- border: 1px solid #fcd34d;
1763
- border-radius: 6px;
1764
- padding: 8px;
1765
- margin: 4px 0 8px;
1766
- }
1767
-
1768
- .remove-orphan-btn {
1769
- display: flex;
1770
- align-items: center;
1771
- justify-content: center;
1772
- width: 100%;
1773
- margin-top: 8px;
1774
- padding: 8px 10px;
1775
- font-size: 11px;
1776
- font-weight: 600;
1777
- color: #991b1b;
1778
- background: #fef2f2;
1779
- border: 1px solid #fecaca;
1780
- border-radius: 6px;
1781
- cursor: pointer;
1782
- }
1783
-
1784
- .remove-orphan-btn:hover {
1785
- background: #fee2e2;
1786
- }
1787
-
1788
- .section-divider {
1789
- padding-top: 8px;
1790
- border-top: 2px solid #d1d5db;
1791
- margin-top: 4px;
1792
- }
1793
-
1794
- /* First section in scrollable area: no top border/padding */
1795
- .section-divider.no-top-border {
1796
- border-top: none;
1797
- margin-top: 0;
1798
- padding-top: 0;
1799
- }
1800
-
1801
- .section-title {
1802
- font-size: 11px;
1803
- font-weight: 700;
1804
- color: #374151;
1805
- text-transform: uppercase;
1806
- letter-spacing: 0.5px;
1807
- text-decoration: underline;
1808
- }
1809
-
1810
- .section-title-inline {
1811
- font-size: 11px;
1812
- font-weight: 700;
1813
- color: #6b7280;
1814
- text-transform: uppercase;
1815
- letter-spacing: 0.5px;
1816
- margin-bottom: 4px;
1817
- }
1818
-
1819
- .prop-section {
1820
- display: flex;
1821
- flex-direction: column;
1822
- gap: 6px;
1823
- }
1824
-
1825
- /* ── Dimensions row (width × lock × height px) ── */
1826
- .dimensions-section {
1827
- gap: 4px;
1828
- }
1829
- .dimensions-label {
1830
- margin-bottom: 0;
1831
- }
1832
- .dimensions-row {
1833
- display: flex;
1834
- align-items: center;
1835
- gap: 4px;
1836
- }
1837
- .dimension-input {
1838
- width: 60px;
1839
- padding: 4px 6px;
1840
- border: 1px solid #d1d5db;
1841
- border-radius: 6px;
1842
- font-size: 12px;
1843
- text-align: center;
1844
- color: #374151;
1845
- background: white;
1846
- outline: none;
1847
- -moz-appearance: textfield;
1848
- appearance: textfield;
1849
- }
1850
- .dimension-input::-webkit-outer-spin-button,
1851
- .dimension-input::-webkit-inner-spin-button {
1852
- -webkit-appearance: none;
1853
- appearance: none;
1854
- margin: 0;
1855
- }
1856
- .dimension-input:focus {
1857
- border-color: var(--accent);
1858
- }
1859
- .dimension-lock-bt {
1860
- display: flex;
1861
- align-items: center;
1862
- justify-content: center;
1863
- width: 24px;
1864
- height: 24px;
1865
- border-radius: 4px;
1866
- cursor: pointer;
1867
- color: #9ca3af;
1868
- flex-shrink: 0;
1869
- transition: color 0.15s, background 0.15s;
1870
- }
1871
- .dimension-lock-bt:hover {
1872
- background: #f3f4f6;
1873
- color: #374151;
1874
- }
1875
- .dimension-lock-bt.locked {
1876
- color: var(--accent);
1877
- }
1878
- .dimension-lock-bt.locked:hover {
1879
- color: var(--accent-hover);
1880
- background: var(--accent-light);
1881
- }
1882
- .dimension-lock-bt.force-locked {
1883
- opacity: 0.6;
1884
- cursor: default;
1885
- }
1886
- .dimension-lock-bt.force-locked:hover {
1887
- background: transparent;
1888
- }
1889
- .dimension-unit {
1890
- font-size: 11px;
1891
- color: #9ca3af;
1892
- flex-shrink: 0;
1893
- }
1894
-
1895
- .prop-label {
1896
- font-size: 11px;
1897
- font-weight: 600;
1898
- color: #6b7280;
1899
- text-transform: uppercase;
1900
- letter-spacing: 0.5px;
1901
- }
1902
-
1903
- .stroke-type-buttons {
1904
- display: flex;
1905
- flex-direction: column;
1906
- gap: 4px;
1907
- }
1908
-
1909
- .stroke-type-btn {
1910
- display: flex;
1911
- align-items: center;
1912
- gap: 8px;
1913
- padding: 6px 8px;
1914
- border: 1px solid #d1d5db;
1915
- border-radius: 4px;
1916
- background: white;
1917
- font-size: 11px;
1918
- cursor: pointer;
1919
- transition: all 0.15s ease;
1920
- }
1921
-
1922
- .stroke-type-btn:hover {
1923
- background: #f3f4f6;
1924
- }
1925
-
1926
- .stroke-type-btn.active {
1927
- background: var(--accent, #314F2F);
1928
- color: white;
1929
- border-color: var(--accent, #314F2F);
1930
- box-shadow: none;
1931
- outline: none;
1932
- }
1933
- .stroke-type-btn:focus-visible {
1934
- outline: none;
1935
- box-shadow: 0 0 0 2px var(--accent, #314F2F);
1936
- }
1937
-
1938
- .stroke-preview {
1939
- width: 24px;
1940
- height: 2px;
1941
- background: currentColor;
1942
- }
1943
-
1944
- .stroke-preview.dashed {
1945
- background: repeating-linear-gradient(
1946
- 90deg,
1947
- currentColor 0px,
1948
- currentColor 6px,
1949
- transparent 6px,
1950
- transparent 10px
1951
- );
1952
- }
1953
-
1954
- .stroke-preview.dotted {
1955
- background: repeating-linear-gradient(
1956
- 90deg,
1957
- currentColor 0px,
1958
- currentColor 2px,
1959
- transparent 2px,
1960
- transparent 5px
1961
- );
1962
- }
1963
-
1964
- /* Text input */
1965
- .text-input {
1966
- width: 100%;
1967
- padding: 6px 8px;
1968
- border: 1px solid #d1d5db;
1969
- border-radius: 4px;
1970
- font-size: 12px;
1971
- }
1972
-
1973
- .text-input:focus {
1974
- outline: none;
1975
- border-color: #3b82f6;
1976
- }
1977
-
1978
- /* Image Source Section */
1979
- .image-source-section {
1980
- gap: 8px;
1981
- }
1982
-
1983
- .source-row {
1984
- display: flex;
1985
- gap: 6px;
1986
- align-items: center;
1987
- }
1988
-
1989
- .source-row.url-row {
1990
- flex-wrap: wrap;
1991
- }
1992
-
1993
- .source-label {
1994
- font-size: 11px;
1995
- font-weight: 600;
1996
- color: #6b7280;
1997
- white-space: nowrap;
1998
- min-width: 32px;
1999
- }
2000
-
2001
- .source-value {
2002
- font-size: 11px;
2003
- color: #111827;
2004
- overflow: hidden;
2005
- text-overflow: ellipsis;
2006
- white-space: nowrap;
2007
- max-width: 130px;
2008
- }
2009
-
2010
- .source-value.url {
2011
- color: #3b82f6;
2012
- }
2013
-
2014
- .source-placeholder {
2015
- font-size: 11px;
2016
- color: #9ca3af;
2017
- font-style: italic;
2018
- }
2019
-
2020
- .source-btn {
2021
- width: 100%;
2022
- padding: 6px 12px;
2023
- background: #f3f4f6;
2024
- color: #374151;
2025
- border: 1px solid #d1d5db;
2026
- border-radius: 4px;
2027
- font-size: 11px;
2028
- font-weight: 500;
2029
- cursor: pointer;
2030
- transition: all 0.15s ease;
2031
- }
2032
-
2033
- .source-btn:hover {
2034
- background: #e5e7eb;
2035
- }
2036
-
2037
- /* URL input */
2038
- .url-input-row {
2039
- display: flex;
2040
- gap: 6px;
2041
- width: 100%;
2042
- }
2043
-
2044
- .url-input {
2045
- flex: 1;
2046
- padding: 6px 8px;
2047
- border: 1px solid #d1d5db;
2048
- border-radius: 4px;
2049
- font-size: 11px;
2050
- min-width: 0;
2051
- }
2052
-
2053
- .url-input:focus {
2054
- outline: none;
2055
- border-color: var(--accent);
2056
- }
2057
-
2058
- .url-load-btn {
2059
- padding: 6px 12px;
2060
- background: var(--accent);
2061
- color: white;
2062
- border: none;
2063
- border-radius: 4px;
2064
- font-size: 11px;
2065
- font-weight: 500;
2066
- cursor: pointer;
2067
- transition: background 0.15s ease;
2068
- white-space: nowrap;
2069
- }
2070
-
2071
- .url-load-btn:hover {
2072
- background: var(--accent-hover);
2073
- }
2074
-
2075
- </style>