@activecollab/components 2.0.397 → 2.0.399

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 (61) hide show
  1. package/dist/cjs/presentation/whiteboard/bottomDock.js +194 -0
  2. package/dist/cjs/presentation/whiteboard/bottomDock.js.map +1 -0
  3. package/dist/cjs/presentation/whiteboard/canvasElements.js +877 -0
  4. package/dist/cjs/presentation/whiteboard/canvasElements.js.map +1 -0
  5. package/dist/cjs/presentation/whiteboard/elements.js +816 -0
  6. package/dist/cjs/presentation/whiteboard/elements.js.map +1 -0
  7. package/dist/cjs/presentation/whiteboard/fileElement.js +457 -0
  8. package/dist/cjs/presentation/whiteboard/fileElement.js.map +1 -0
  9. package/dist/cjs/presentation/whiteboard/glyphs.js +67 -0
  10. package/dist/cjs/presentation/whiteboard/glyphs.js.map +1 -0
  11. package/dist/cjs/presentation/whiteboard/inspector.js +884 -0
  12. package/dist/cjs/presentation/whiteboard/inspector.js.map +1 -0
  13. package/dist/cjs/presentation/whiteboard/linkElement.js +357 -0
  14. package/dist/cjs/presentation/whiteboard/linkElement.js.map +1 -0
  15. package/dist/cjs/presentation/whiteboard/outline.js +966 -0
  16. package/dist/cjs/presentation/whiteboard/outline.js.map +1 -0
  17. package/dist/cjs/presentation/whiteboard/peopleMenu.js +516 -0
  18. package/dist/cjs/presentation/whiteboard/peopleMenu.js.map +1 -0
  19. package/dist/cjs/presentation/whiteboard/settingsMenu.js +177 -0
  20. package/dist/cjs/presentation/whiteboard/settingsMenu.js.map +1 -0
  21. package/dist/esm/presentation/whiteboard/bottomDock.d.ts +51 -0
  22. package/dist/esm/presentation/whiteboard/bottomDock.d.ts.map +1 -0
  23. package/dist/esm/presentation/whiteboard/bottomDock.js +162 -0
  24. package/dist/esm/presentation/whiteboard/bottomDock.js.map +1 -0
  25. package/dist/esm/presentation/whiteboard/canvasElements.d.ts +61 -0
  26. package/dist/esm/presentation/whiteboard/canvasElements.d.ts.map +1 -0
  27. package/dist/esm/presentation/whiteboard/canvasElements.js +746 -0
  28. package/dist/esm/presentation/whiteboard/canvasElements.js.map +1 -0
  29. package/dist/esm/presentation/whiteboard/elements.d.ts +180 -0
  30. package/dist/esm/presentation/whiteboard/elements.d.ts.map +1 -0
  31. package/dist/esm/presentation/whiteboard/elements.js +736 -0
  32. package/dist/esm/presentation/whiteboard/elements.js.map +1 -0
  33. package/dist/esm/presentation/whiteboard/fileElement.d.ts +113 -0
  34. package/dist/esm/presentation/whiteboard/fileElement.d.ts.map +1 -0
  35. package/dist/esm/presentation/whiteboard/fileElement.js +430 -0
  36. package/dist/esm/presentation/whiteboard/fileElement.js.map +1 -0
  37. package/dist/esm/presentation/whiteboard/glyphs.d.ts +32 -0
  38. package/dist/esm/presentation/whiteboard/glyphs.d.ts.map +1 -0
  39. package/dist/esm/presentation/whiteboard/glyphs.js +50 -0
  40. package/dist/esm/presentation/whiteboard/glyphs.js.map +1 -0
  41. package/dist/esm/presentation/whiteboard/inspector.d.ts +100 -0
  42. package/dist/esm/presentation/whiteboard/inspector.d.ts.map +1 -0
  43. package/dist/esm/presentation/whiteboard/inspector.js +753 -0
  44. package/dist/esm/presentation/whiteboard/inspector.js.map +1 -0
  45. package/dist/esm/presentation/whiteboard/linkElement.d.ts +97 -0
  46. package/dist/esm/presentation/whiteboard/linkElement.d.ts.map +1 -0
  47. package/dist/esm/presentation/whiteboard/linkElement.js +327 -0
  48. package/dist/esm/presentation/whiteboard/linkElement.js.map +1 -0
  49. package/dist/esm/presentation/whiteboard/outline.d.ts +89 -0
  50. package/dist/esm/presentation/whiteboard/outline.d.ts.map +1 -0
  51. package/dist/esm/presentation/whiteboard/outline.js +870 -0
  52. package/dist/esm/presentation/whiteboard/outline.js.map +1 -0
  53. package/dist/esm/presentation/whiteboard/peopleMenu.d.ts +44 -0
  54. package/dist/esm/presentation/whiteboard/peopleMenu.d.ts.map +1 -0
  55. package/dist/esm/presentation/whiteboard/peopleMenu.js +440 -0
  56. package/dist/esm/presentation/whiteboard/peopleMenu.js.map +1 -0
  57. package/dist/esm/presentation/whiteboard/settingsMenu.d.ts +13 -0
  58. package/dist/esm/presentation/whiteboard/settingsMenu.d.ts.map +1 -0
  59. package/dist/esm/presentation/whiteboard/settingsMenu.js +155 -0
  60. package/dist/esm/presentation/whiteboard/settingsMenu.js.map +1 -0
  61. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspector.js","names":["React","useCallback","useState","styled","BORDER_STYLE_OPTIONS","CANVAS_ELEMENTS","COLOR_OPTIONS","ELEMENT_BODIES","FONT_SIZE_OPTIONS","OPACITY_OPTIONS","RADIUS_OPTIONS","SHAPE_TYPE_ICON","THICKNESS_OPTIONS","ALIGN_OPTIONS","STYLE_OPTIONS","formatFileSize","OUTLINE_MAX_WIDTH","OUTLINE_MIN_WIDTH","OUTLINE_WIDTH","StyledChooseRow","StyledPanelChooseSlot","Checkbox","ChooseV2","Dot","EditableText","IconButton","AttachmentIcon","CircleSlashIcon","InsertLinkIcon","NoteIcon","Input","InputAdornment","InputNumber","Label","Select","SelectTrigger","Tooltip","Body2","Caption1","elementTraits","def","kind","geometry","fill","fillTransparent","stroke","text","autoHeight","TYPE_LABEL","rectangle","roundedRectangle","circle","triangle","sameColor","a","b","toLowerCase","StyledInspectorSidebar","aside","withConfig","displayName","componentId","StyledInspectorResizer","div","StyledInspectorBody","StyledPropGroups","StyledInspectorHeader","StyledInspectorEmpty","StyledPropGroup","StyledPropRow","StyledFieldGrid","StyledControl","StyledCheckboxRow","StyledBody","StyledAutoField","StyledSegmented","NumberField","_ref","label","value","min","unit","onCommit","createElement","size","weight","className","decimalLength","update","endAdornment","disablePointerEvents","color","undefined","onChange","next","Number","isNaN","Math","round","AutoField","_ref2","OptionSelect","_ref3","options","triggerLabel","type","disableSearch","forceCloseMenu","selected","Array","isArray","target","TRANSPARENT_OPTION","id","name","textColor","colorName","hex","match","find","option","ColorPickerField","_ref4","disabled","includeTransparent","onSelect","isTransparent","String","width","height","RightInspector","_ref5","_sizes$def$id","_positions$def$id","_rotations$def$id","_names$def$id","_shape$align","_BORDER_STYLE_OPTIONS","_BORDER_STYLE_OPTIONS2","selectedId","positions","setPositions","sizes","setSizes","rotations","setRotations","shapes","setShapes","stickyStyle","setStickyStyle","links","setLinks","files","setFiles","createdShapes","locks","setLocks","_useState","setWidth","_useState2","resizing","setResizing","_useState3","names","setNames","_useState4","tab","setTab","startResize","event","_event$currentTarget$","_event$currentTarget$2","preventDefault","startX","clientX","startWidth","currentTarget","parentElement","offsetWidth","previousUserSelect","document","body","style","userSelect","cursor","handleMove","moveEvent","max","handleUp","window","removeEventListener","addEventListener","element","linkDef","link","fileDef","file","shell","content","onMouseDown","role","renderBody","_ELEMENT_BODIES$id","html","dangerouslySetInnerHTML","__html","renderLocked","_locks$id","checked","current","_current$id","_extends","htmlFor","renderCardGeometry","cardWidth","onWidth","_positions$id","cardPosition","x","y","_current$id2","_current$id3","renderInspectorBody","icon","headerName","groups","variant","onSave","inputProps","maxLength","required","_names$linkDef$id","_linkDef$url","url","Fragment","placeholder","map","_names$fileDef$id","base","extension","traits","shape","position","rotation","typeLabel","updateShape","partial","currentFill","currentFillOpacity","fillOpacity","setFill","setFillOpacity","currentFontSize","fontSize","currentAlign","align","setFontSize","setAlign","styleFlags","toggleStyle","key","shapeType","autoWidth","_current$def$id$heigh","_current$def$id","_current$def$id$width","_current$def$id2","opacity","strokeDash","_BORDER_STYLE_OPTIONS3","thickness","strokeWidth","radius","borderRadius","strokeOpacity","title","active","onClick"],"sources":["../../../../src/presentation/whiteboard/inspector.tsx"],"sourcesContent":["import React, { ReactElement, ReactNode, useCallback, useState } from \"react\";\n\nimport styled from \"styled-components\";\n\nimport {\n BORDER_STYLE_OPTIONS,\n CANVAS_ELEMENTS,\n COLOR_OPTIONS,\n CanvasElementDef,\n ELEMENT_BODIES,\n FONT_SIZE_OPTIONS,\n OPACITY_OPTIONS,\n RADIUS_OPTIONS,\n SHAPE_TYPE_ICON,\n ShapeElementState,\n ShapeType,\n StickyTextStyle,\n THICKNESS_OPTIONS,\n TextAlign,\n ALIGN_OPTIONS,\n STYLE_OPTIONS,\n TextStyleKey,\n} from \"./elements\";\nimport { FileElementDef, formatFileSize } from \"./fileElement\";\nimport { LinkElementDef } from \"./linkElement\";\nimport {\n OUTLINE_MAX_WIDTH,\n OUTLINE_MIN_WIDTH,\n OUTLINE_WIDTH,\n StyledChooseRow,\n StyledPanelChooseSlot,\n} from \"./outline\";\nimport { Checkbox } from \"../../components/Checkbox\";\nimport { ChooseV2 } from \"../../components/ChooseV2\";\nimport { Dot } from \"../../components/Dot\";\nimport { EditableText } from \"../../components/EditableText\";\nimport { IconButton } from \"../../components/IconButton\";\nimport {\n AttachmentIcon,\n CircleSlashIcon,\n InsertLinkIcon,\n NoteIcon,\n} from \"../../components/Icons\";\nimport { Input, InputAdornment, InputNumber } from \"../../components/Input\";\nimport { Label } from \"../../components/Label\";\nimport { Select } from \"../../components/Select\";\nimport { SelectTrigger } from \"../../components/SelectTrigger\";\nimport { Tooltip } from \"../../components/Tooltip\";\nimport { Body2, Caption1 } from \"../../components/Typography\";\n\n/* ------------------------------------------------------------------ */\n/* Right Inspector — selected-element properties panel */\n/* ------------------------------------------------------------------ */\n\n/* Which right-docked panel is open. Only \"inspector\" is built here; \"comments\"\n is reserved for the next iteration. */\nexport type RightPanel = \"inspector\" | \"comments\" | null;\n\n/* ── Inspector capability traits ──────────────────────────────────────────\n The Inspector is TRAIT-DRIVEN: a selected element declares which property\n groups it supports, and only those groups render. This is the \"interface\n with implementation traits\" model — the interface is the full set of groups,\n and each element kind overrides the flags it does not support (a sticky has\n no stroke, and its height is auto because the note grows with its content).\n New element kinds slot in by returning their own trait set. */\nexport interface ElementTraits {\n geometry: boolean;\n fill: boolean;\n /* Whether this element's fill may be Transparent. Distinct from `fill`: a\n sticky HAS a fill group but must not be transparent (its colour is its\n defining property), whereas an outline-only shape is valid. Mirrors the\n app's `fillTransparent` trait. */\n fillTransparent?: boolean;\n stroke: boolean;\n text: boolean;\n autoWidth?: boolean;\n autoHeight?: boolean;\n}\n\nexport const elementTraits = (def: CanvasElementDef): ElementTraits =>\n def.kind === \"sticky\"\n ? {\n geometry: true,\n fill: true,\n fillTransparent: false,\n stroke: false,\n text: true,\n autoHeight: true,\n }\n : {\n geometry: true,\n fill: true,\n fillTransparent: true,\n stroke: true,\n text: true,\n };\n\nexport const TYPE_LABEL: Record<ShapeType, string> = {\n rectangle: \"Rectangle\",\n roundedRectangle: \"Rounded Rectangle\",\n circle: \"Circle\",\n triangle: \"Triangle\",\n};\n\nexport const sameColor = (a: string | undefined, b: string): boolean =>\n (a ?? \"\").toLowerCase() === b.toLowerCase();\n\n/* Right dock — mirrors StyledOutlineSidebar but docked on the RIGHT: border on\n the left edge, resizer on the left edge. Same 260–780 width band. */\nexport const StyledInspectorSidebar = styled.aside`\n flex-shrink: 0;\n position: relative;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n border-left: 1px solid var(--selectable);\n background-color: var(--page-paper-main);\n font-family: -apple-system, BlinkMacSystemFont, \"Roboto\", \"Helvetica Neue\",\n Arial, sans-serif;\n`;\n\n/* Grab strip on the LEFT edge, because the panel is docked right — dragging it\n left widens. Same token pair as the outline resizer: selectable grey at\n rest, the hover token while grabbed. */\nexport const StyledInspectorResizer = styled.div`\n position: absolute;\n top: 0;\n bottom: 0;\n left: -2px;\n width: 5px;\n cursor: col-resize;\n z-index: 2;\n\n &::after {\n content: \"\";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 2px;\n width: 1px;\n background-color: var(--selectable-active);\n opacity: 0;\n transition: opacity 150ms ease;\n }\n\n &:hover::after,\n &.resizing::after {\n opacity: 1;\n }\n`;\n\nexport const StyledInspectorBody = styled.div`\n flex: 1;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n`;\n\n/* Wraps the property groups. The Properties/Comments switch above does the\n separating, so the first group drops its top hairline — no divider directly\n under the header, matching the left sidebar. Inner groups keep separators. */\nexport const StyledPropGroups = styled.div`\n display: flex;\n flex-direction: column;\n\n > div:first-child {\n border-top: none;\n }\n`;\n\nexport const StyledInspectorHeader = styled.div`\n display: flex;\n align-items: center;\n gap: 8px;\n height: 56px;\n padding: 0 16px;\n box-sizing: border-box;\n flex-shrink: 0;\n\n /* Icon in a fixed, centred box (like the outline's type icon and the sidebar\n header) so it lines up with the live EditableText's text rather than the\n taller input box. */\n .inspector-type-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n flex-shrink: 0;\n color: var(--color-theme-700);\n }\n\n .inspector-type-icon svg {\n width: 20px;\n height: 20px;\n }\n\n .inspector-name {\n flex: 1;\n min-width: 0;\n }\n`;\n\n/* Empty state — same muted treatment the outline uses for unnamed rows. */\nexport const StyledInspectorEmpty = styled.div`\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 24px;\n text-align: center;\n color: var(--color-theme-600);\n`;\n\n/* Non-collapsible section: bold title, no chevron / drag handle, separated from\n the section above by a hairline. */\nexport const StyledPropGroup = styled.div`\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 16px;\n border-top: 1px solid var(--border-primary);\n\n .group-title {\n color: var(--color-theme-800);\n }\n`;\n\nexport const StyledPropRow = styled.div`\n display: flex;\n flex-direction: column;\n gap: 4px;\n`;\n\nexport const StyledFieldGrid = styled.div`\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 12px;\n`;\n\n/* InputNumber's wrapper is a fixed 360px and SelectTrigger a fixed 300px — both\n overflow the narrow dock, so force every inspector control to fill its cell. */\nexport const StyledControl = styled.div`\n width: 100%;\n\n &.disabled {\n opacity: 0.4;\n pointer-events: none;\n }\n\n .c-input-wrapper {\n width: 100%;\n }\n\n .wb-inspector-trigger {\n width: 100%;\n }\n\n .wb-color-value {\n display: flex;\n align-items: center;\n gap: 8px;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n /* A transparent fill has no colour to show, so it renders the design-system\n CircleSlashIcon (a ring with a 45° slash) instead of an invisible dot. */\n .wb-color-value .wb-transparent-swatch {\n flex: none;\n color: var(--color-theme-500);\n }\n`;\n\n/* Locked checkbox row — the DS Checkbox renders only the box, so it is paired\n with a Label the way the design system expects. */\nexport const StyledCheckboxRow = styled.div`\n display: flex;\n align-items: center;\n gap: 8px;\n`;\n\n/* The element body is HTML (the API's `body` field). The Inspector renders it\n formatted and read-only for now — editing comes later. Raw text needs an\n explicit font-family (no global reset), and the child tags get light prose\n styling. */\nexport const StyledBody = styled.div`\n width: 100%;\n /* Collapsed to a reasonable height; a long body scrolls inside the field. */\n max-height: 140px;\n overflow-y: auto;\n font-family: -apple-system, BlinkMacSystemFont, \"Roboto\", \"Helvetica Neue\",\n Arial, sans-serif;\n font-size: 13px;\n line-height: 1.5;\n color: var(--color-theme-800);\n\n p {\n margin: 0 0 8px;\n }\n\n p:last-child {\n margin-bottom: 0;\n }\n\n ul,\n ol {\n margin: 0 0 8px;\n padding-left: 18px;\n }\n\n li {\n margin: 2px 0;\n }\n\n strong {\n font-weight: 600;\n }\n\n em {\n font-style: italic;\n }\n\n a {\n color: var(--color-primary);\n }\n`;\n\n/* Read-only \"Auto\" field for an auto-sized dimension (a sticky's height). */\nexport const StyledAutoField = styled.div`\n height: 32px;\n display: flex;\n align-items: center;\n padding: 0 8px;\n box-sizing: border-box;\n border: 1px solid var(--color-theme-400);\n border-radius: var(--ac-br-8);\n background-color: var(--color-theme-200);\n color: var(--color-theme-600);\n font-size: 13px;\n`;\n\nexport const StyledSegmented = styled.div`\n display: flex;\n gap: 4px;\n\n /* Icon segments (text alignment): size the glyph and center it in the cell so\n each Choose reads as an equal-width icon button. */\n svg {\n display: block;\n width: 16px;\n height: 16px;\n }\n`;\n\nexport interface NumberFieldProps {\n label: string;\n value: number;\n min?: number;\n /* Unit shown as a right adornment inside the field (px, °), the same way\n InputCurrency shows the currency code. */\n unit?: string;\n onCommit: (value: number) => void;\n}\n\nexport const NumberField = ({\n label,\n value,\n min,\n unit,\n onCommit,\n}: NumberFieldProps): ReactElement => (\n <StyledPropRow>\n <Label size=\"small\" weight=\"regular\">\n {label}\n </Label>\n <StyledControl>\n <InputNumber\n className=\"wb-inspector-num\"\n value={value}\n decimalLength={0}\n min={min}\n update\n endAdornment={\n unit ? (\n <InputAdornment disablePointerEvents>\n <Caption1 color=\"secondary\">{unit}</Caption1>\n </InputAdornment>\n ) : undefined\n }\n onChange={(next) => {\n if (next !== undefined && !Number.isNaN(next)) {\n onCommit(Math.round(next));\n }\n }}\n />\n </StyledControl>\n </StyledPropRow>\n);\n\nexport const AutoField = ({ label }: { label: string }): ReactElement => (\n <StyledPropRow>\n <Label size=\"small\" weight=\"regular\">\n {label}\n </Label>\n <StyledAutoField>Auto</StyledAutoField>\n </StyledPropRow>\n);\n\nexport interface OptionSelectProps {\n options: { id: string | number; name: string }[];\n value: string | number;\n triggerLabel: string;\n onChange: (value: string | number) => void;\n}\n\nexport const OptionSelect = ({\n options,\n value,\n triggerLabel,\n onChange,\n}: OptionSelectProps): ReactElement => (\n <StyledControl>\n <Select\n type=\"single\"\n disableSearch\n forceCloseMenu\n options={options}\n selected={value}\n onChange={(next) => onChange(Array.isArray(next) ? next[0] : next)}\n target={\n <SelectTrigger className=\"wb-inspector-trigger\">\n {triggerLabel}\n </SelectTrigger>\n }\n />\n </StyledControl>\n);\n\nexport const TRANSPARENT_OPTION = {\n id: \"transparent\",\n name: \"Transparent\",\n color: \"transparent\",\n textColor: \"transparent\",\n};\n\n/* The name shown on the color picker's trigger, resolved from the current hex. */\nexport const colorName = (hex: string | undefined): string => {\n if (!hex || sameColor(hex, \"transparent\")) {\n return \"Transparent\";\n }\n\n const match = COLOR_OPTIONS.find((option) => sameColor(hex, option.color));\n return match ? match.name : \"Custom\";\n};\n\nexport interface ColorPickerFieldProps {\n value: string | undefined;\n disabled?: boolean;\n /* Adds \"Transparent\" as the first option, rendered as the DS CircleSlashIcon.\n Driven by the element's `fillTransparent` trait, so only SHAPE fill opts in\n — sticky fill (its colour is the point) and stroke colour never do. */\n includeTransparent?: boolean;\n onSelect: (color: string) => void;\n}\n\n/* The regular design-system named-colour picker (the one in the label dialogs):\n a Select whose trigger is a Dot + colour name, and whose menu is the standard\n dot-and-radio list. Custom colours are deferred. */\nexport const ColorPickerField = ({\n value,\n disabled,\n includeTransparent,\n onSelect,\n}: ColorPickerFieldProps): ReactElement => {\n const options = includeTransparent\n ? [TRANSPARENT_OPTION, ...COLOR_OPTIONS]\n : COLOR_OPTIONS;\n const isTransparent = !value || sameColor(value, \"transparent\");\n\n return (\n <StyledControl className={disabled ? \"disabled\" : undefined}>\n <Select\n type=\"single\"\n disableSearch\n forceCloseMenu\n options={options}\n selected={isTransparent ? \"transparent\" : value}\n onChange={(next) =>\n onSelect(String(Array.isArray(next) ? next[0] : next))\n }\n target={\n <SelectTrigger className=\"wb-inspector-trigger\">\n <span className=\"wb-color-value\">\n {isTransparent ? (\n <CircleSlashIcon\n width={14}\n height={14}\n fill=\"currentColor\"\n className=\"wb-transparent-swatch\"\n />\n ) : (\n <Dot color={value} size={14} />\n )}\n {colorName(value)}\n </span>\n </SelectTrigger>\n }\n />\n </StyledControl>\n );\n};\n\nexport interface RightInspectorProps {\n selectedId: string | null;\n positions: Record<string, { x: number; y: number }>;\n setPositions: React.Dispatch<\n React.SetStateAction<Record<string, { x: number; y: number }>>\n >;\n sizes: Record<string, { width: number; height: number }>;\n setSizes: React.Dispatch<\n React.SetStateAction<Record<string, { width: number; height: number }>>\n >;\n rotations: Record<string, number>;\n setRotations: React.Dispatch<React.SetStateAction<Record<string, number>>>;\n shapes: Record<string, ShapeElementState>;\n setShapes: React.Dispatch<\n React.SetStateAction<Record<string, ShapeElementState>>\n >;\n stickyStyle: StickyTextStyle;\n setStickyStyle: React.Dispatch<React.SetStateAction<StickyTextStyle>>;\n links: LinkElementDef[];\n setLinks: React.Dispatch<React.SetStateAction<LinkElementDef[]>>;\n files: FileElementDef[];\n setFiles: React.Dispatch<React.SetStateAction<FileElementDef[]>>;\n createdShapes: CanvasElementDef[];\n locks: Record<string, boolean>;\n setLocks: React.Dispatch<React.SetStateAction<Record<string, boolean>>>;\n}\n\nexport const RightInspector = ({\n selectedId,\n positions,\n setPositions,\n sizes,\n setSizes,\n rotations,\n setRotations,\n shapes,\n setShapes,\n stickyStyle,\n setStickyStyle,\n links,\n setLinks,\n files,\n setFiles,\n createdShapes,\n locks,\n setLocks,\n}: RightInspectorProps): ReactElement => {\n const [width, setWidth] = useState(OUTLINE_WIDTH);\n const [resizing, setResizing] = useState(false);\n /* Mock only — element display names are not persisted anywhere; they default\n to the type label until renamed here. */\n const [names, setNames] = useState<Record<string, string>>({});\n /* Which inspector tab is showing: the property groups we design, or the\n upcoming comments stream (details TBD). */\n const [tab, setTab] = useState<\"properties\" | \"comments\">(\"properties\");\n\n /* Docked right, so the grab strip is on the LEFT edge and dragging left\n widens: the delta is subtracted rather than added (see LeftSidebar). */\n const startResize = useCallback((event: React.MouseEvent) => {\n event.preventDefault();\n const startX = event.clientX;\n const startWidth = event.currentTarget.parentElement?.offsetWidth ?? 0;\n const previousUserSelect = document.body.style.userSelect;\n\n setResizing(true);\n document.body.style.userSelect = \"none\";\n document.body.style.cursor = \"col-resize\";\n\n const handleMove = (moveEvent: MouseEvent): void => {\n const next = startWidth - (moveEvent.clientX - startX);\n setWidth(Math.min(OUTLINE_MAX_WIDTH, Math.max(OUTLINE_MIN_WIDTH, next)));\n };\n\n const handleUp = (): void => {\n setResizing(false);\n document.body.style.userSelect = previousUserSelect;\n document.body.style.cursor = \"\";\n window.removeEventListener(\"mousemove\", handleMove);\n window.removeEventListener(\"mouseup\", handleUp);\n };\n\n window.addEventListener(\"mousemove\", handleMove);\n window.addEventListener(\"mouseup\", handleUp);\n }, []);\n\n const def = selectedId\n ? [...CANVAS_ELEMENTS, ...createdShapes].find(\n (element) => element.id === selectedId\n )\n : undefined;\n const linkDef = selectedId\n ? links.find((link) => link.id === selectedId)\n : undefined;\n const fileDef = selectedId\n ? files.find((file) => file.id === selectedId)\n : undefined;\n\n const shell = (content: ReactNode): ReactElement => (\n <StyledInspectorSidebar style={{ width }}>\n <StyledInspectorResizer\n className={resizing ? \"resizing\" : \"\"}\n onMouseDown={startResize}\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label=\"Resize inspector\"\n />\n {content}\n </StyledInspectorSidebar>\n );\n\n /* Description — inline, multi-line editable text, shown first for every\n element kind. */\n /* Read-only formatted body (HTML from the API's `body` field). No label; when\n the body is empty the field is not rendered at all. No edit yet. */\n const renderBody = (id: string): ReactNode => {\n const html = ELEMENT_BODIES[id] ?? \"\";\n if (!html) {\n return null;\n }\n\n // eslint-disable-next-line react/no-danger\n return <StyledBody dangerouslySetInnerHTML={{ __html: html }} />;\n };\n\n /* The Locked checkbox — shown for every element kind, toggling a design lock\n flag keyed by element id. */\n const renderLocked = (id: string): ReactElement => (\n <StyledCheckboxRow>\n <Checkbox\n id={`wb-lock-${id}`}\n checked={locks[id] ?? false}\n onChange={() =>\n setLocks((current) => ({ ...current, [id]: !(current[id] ?? false) }))\n }\n />\n <Label htmlFor={`wb-lock-${id}`} size=\"small\" weight=\"regular\">\n Locked\n </Label>\n </StyledCheckboxRow>\n );\n\n /* Geometry for a card (link / file): X/Y from the shared positions map, an\n editable width and an auto height (cards are content-sized). Cards cannot\n be rotated, so there is no Rotation field. */\n const renderCardGeometry = (\n id: string,\n cardWidth: number,\n onWidth: (width: number) => void\n ): ReactElement => {\n const cardPosition = positions[id] ?? { x: 0, y: 0 };\n\n return (\n <StyledPropGroup>\n <Body2 weight=\"bold\" className=\"group-title\">\n Geometry\n </Body2>\n <StyledFieldGrid>\n <NumberField\n label=\"X\"\n unit=\"px\"\n value={cardPosition.x}\n onCommit={(next) =>\n setPositions((current) => ({\n ...current,\n [id]: { ...(current[id] ?? { x: 0, y: 0 }), x: next },\n }))\n }\n />\n <NumberField\n label=\"Y\"\n unit=\"px\"\n value={cardPosition.y}\n onCommit={(next) =>\n setPositions((current) => ({\n ...current,\n [id]: { ...(current[id] ?? { x: 0, y: 0 }), y: next },\n }))\n }\n />\n </StyledFieldGrid>\n <StyledFieldGrid>\n <NumberField\n label=\"Width\"\n unit=\"px\"\n value={cardWidth}\n min={1}\n onCommit={onWidth}\n />\n <AutoField label=\"Height\" />\n </StyledFieldGrid>\n </StyledPropGroup>\n );\n };\n\n /* Header + panel switch + body, shared by every element kind — only the\n groups inside differ. */\n const renderInspectorBody = (\n icon: ReactNode,\n headerName: string,\n id: string,\n groups: ReactNode\n ): ReactElement => (\n <StyledInspectorBody>\n <StyledInspectorHeader>\n <span className=\"inspector-type-icon\">{icon}</span>\n <span className=\"inspector-name\">\n <EditableText\n value={headerName}\n variant=\"Header 3\"\n weight=\"bold\"\n onSave={(event) =>\n setNames((current) => ({ ...current, [id]: event.target.value }))\n }\n inputProps={{ maxLength: 120 }}\n />\n </span>\n </StyledInspectorHeader>\n\n <StyledChooseRow>\n <StyledPanelChooseSlot>\n <ChooseV2\n required\n options={[\n { id: \"properties\", name: \"Properties\" },\n { id: \"comments\", name: \"Comments\" },\n ]}\n selected={[tab]}\n onChange={(selected) =>\n setTab(selected[0] as \"properties\" | \"comments\")\n }\n />\n </StyledPanelChooseSlot>\n </StyledChooseRow>\n\n {tab === \"comments\" ? (\n <StyledInspectorEmpty>\n <Body2>The comments stream is coming soon.</Body2>\n </StyledInspectorEmpty>\n ) : (\n <StyledPropGroups>{groups}</StyledPropGroups>\n )}\n </StyledInspectorBody>\n );\n\n /* Nothing selected. */\n if (!def && !linkDef && !fileDef) {\n return shell(\n <StyledInspectorEmpty>\n <Body2>Select an element to see its properties.</Body2>\n </StyledInspectorEmpty>\n );\n }\n\n /* Link card — its URL plus the shared Locked flag. */\n if (linkDef) {\n return shell(\n renderInspectorBody(\n <InsertLinkIcon />,\n names[linkDef.id] ?? (linkDef.url || \"Link\"),\n linkDef.id,\n <>\n <StyledPropGroup>\n {renderBody(linkDef.id)}\n <StyledPropRow>\n <Label size=\"small\" weight=\"regular\">\n URL\n </Label>\n <StyledControl>\n <Input\n value={linkDef.url ?? \"\"}\n placeholder=\"https://…\"\n onChange={(event) =>\n setLinks((current) =>\n current.map((link) =>\n link.id === linkDef.id\n ? { ...link, url: event.target.value }\n : link\n )\n )\n }\n />\n </StyledControl>\n </StyledPropRow>\n {renderLocked(linkDef.id)}\n </StyledPropGroup>\n {renderCardGeometry(linkDef.id, linkDef.width, (width) =>\n setLinks((current) =>\n current.map((link) =>\n link.id === linkDef.id ? { ...link, width } : link\n )\n )\n )}\n </>\n )\n );\n }\n\n /* File card — read-only size plus the shared Locked flag. */\n if (fileDef) {\n return shell(\n renderInspectorBody(\n <AttachmentIcon />,\n names[fileDef.id] ??\n (fileDef.file\n ? `${fileDef.file.base}.${fileDef.file.extension}`\n : \"File\"),\n fileDef.id,\n <>\n <StyledPropGroup>\n {renderBody(fileDef.id)}\n <StyledPropRow>\n <Label size=\"small\" weight=\"regular\">\n Size\n </Label>\n <StyledAutoField>\n {fileDef.file ? formatFileSize(fileDef.file.size) : \"—\"}\n </StyledAutoField>\n </StyledPropRow>\n {renderLocked(fileDef.id)}\n </StyledPropGroup>\n {renderCardGeometry(fileDef.id, fileDef.width, (width) =>\n setFiles((current) =>\n current.map((file) =>\n file.id === fileDef.id ? { ...file, width } : file\n )\n )\n )}\n </>\n )\n );\n }\n\n /* Shape / sticky from here on. */\n if (!def) {\n return shell(\n <StyledInspectorEmpty>\n <Body2>Select an element to see its properties.</Body2>\n </StyledInspectorEmpty>\n );\n }\n\n const traits = elementTraits(def);\n const shape = def.kind === \"shape\" ? shapes[def.id] : null;\n const size = sizes[def.id] ?? { width: def.width, height: def.height };\n const position = positions[def.id] ?? { x: def.x, y: def.y };\n const rotation = rotations[def.id] ?? 0;\n\n const typeLabel = shape ? TYPE_LABEL[shape.type] : \"Sticky note\";\n const name = names[def.id] ?? typeLabel;\n\n const updateShape = (partial: Partial<ShapeElementState>): void =>\n setShapes((current) => ({\n ...current,\n [def.id]: { ...current[def.id], ...partial },\n }));\n\n /* Fill is unified across kinds: a shape writes shape.fill, a sticky its note\n colour. A transparent colour means no fill. */\n const currentFill = shape ? shape.fill : stickyStyle.color;\n const currentFillOpacity = shape\n ? shape.fillOpacity\n : stickyStyle.fillOpacity;\n\n const setFill = (color: string): void => {\n if (shape) {\n updateShape({ fill: color });\n } else {\n setStickyStyle({ ...stickyStyle, color });\n }\n };\n\n const setFillOpacity = (next: number): void => {\n if (shape) {\n updateShape({ fillOpacity: next });\n } else {\n setStickyStyle({ ...stickyStyle, fillOpacity: next });\n }\n };\n\n const currentFontSize = shape ? shape.fontSize : stickyStyle.fontSize;\n const currentAlign: TextAlign = shape\n ? shape.align ?? \"left\"\n : stickyStyle.align;\n\n const setFontSize = (next: number): void => {\n if (shape) {\n updateShape({ fontSize: next });\n } else {\n setStickyStyle({ ...stickyStyle, fontSize: next });\n }\n };\n\n const setAlign = (next: TextAlign): void => {\n if (shape) {\n updateShape({ align: next });\n } else {\n setStickyStyle({ ...stickyStyle, align: next });\n }\n };\n\n const styleFlags = shape ?? stickyStyle;\n\n const toggleStyle = (key: TextStyleKey): void => {\n if (shape) {\n updateShape({ [key]: !shape[key] });\n } else {\n setStickyStyle({ ...stickyStyle, [key]: !stickyStyle[key] });\n }\n };\n\n return shell(\n renderInspectorBody(\n shape ? SHAPE_TYPE_ICON[shape.type] : <NoteIcon />,\n name,\n def.id,\n <>\n {/* Element-specific properties — no header, sits above Geometry. */}\n <StyledPropGroup>\n {renderBody(def.id)}\n {shape ? (\n <StyledPropRow>\n <Label size=\"small\" weight=\"regular\">\n Shape\n </Label>\n <OptionSelect\n options={(\n [\n \"rectangle\",\n \"roundedRectangle\",\n \"circle\",\n \"triangle\",\n ] as ShapeType[]\n ).map((shapeType) => ({\n id: shapeType,\n name: TYPE_LABEL[shapeType],\n }))}\n value={shape.type}\n triggerLabel={TYPE_LABEL[shape.type]}\n onChange={(next) => updateShape({ type: next as ShapeType })}\n />\n </StyledPropRow>\n ) : null}\n {renderLocked(def.id)}\n </StyledPropGroup>\n\n {traits.geometry ? (\n <StyledPropGroup>\n <Body2 weight=\"bold\" className=\"group-title\">\n Geometry\n </Body2>\n <StyledFieldGrid>\n <NumberField\n label=\"X\"\n unit=\"px\"\n value={position.x}\n onCommit={(next) =>\n setPositions((current) => ({\n ...current,\n [def.id]: { ...current[def.id], x: next },\n }))\n }\n />\n <NumberField\n label=\"Y\"\n unit=\"px\"\n value={position.y}\n onCommit={(next) =>\n setPositions((current) => ({\n ...current,\n [def.id]: { ...current[def.id], y: next },\n }))\n }\n />\n </StyledFieldGrid>\n <StyledFieldGrid>\n {traits.autoWidth ? (\n <AutoField label=\"Width\" />\n ) : (\n <NumberField\n label=\"Width\"\n unit=\"px\"\n value={size.width}\n min={1}\n onCommit={(next) =>\n setSizes((current) => ({\n ...current,\n [def.id]: {\n width: next,\n height: current[def.id]?.height ?? def.height,\n },\n }))\n }\n />\n )}\n {traits.autoHeight ? (\n <AutoField label=\"Height\" />\n ) : (\n <NumberField\n label=\"Height\"\n unit=\"px\"\n value={size.height}\n min={1}\n onCommit={(next) =>\n setSizes((current) => ({\n ...current,\n [def.id]: {\n width: current[def.id]?.width ?? def.width,\n height: next,\n },\n }))\n }\n />\n )}\n </StyledFieldGrid>\n <StyledFieldGrid>\n <NumberField\n label=\"Rotation\"\n unit=\"°\"\n value={rotation}\n onCommit={(next) =>\n setRotations((current) => ({ ...current, [def.id]: next }))\n }\n />\n </StyledFieldGrid>\n </StyledPropGroup>\n ) : null}\n\n {traits.fill ? (\n <StyledPropGroup>\n <Body2 weight=\"bold\" className=\"group-title\">\n Fill\n </Body2>\n <StyledFieldGrid>\n <StyledPropRow>\n <Label size=\"small\" weight=\"regular\">\n Color\n </Label>\n <ColorPickerField\n includeTransparent={traits.fillTransparent}\n value={currentFill}\n onSelect={setFill}\n />\n </StyledPropRow>\n <StyledPropRow>\n <Label size=\"small\" weight=\"regular\">\n Opacity\n </Label>\n <OptionSelect\n options={OPACITY_OPTIONS.map((opacity) => ({\n id: opacity,\n name: `${opacity}%`,\n }))}\n value={currentFillOpacity}\n triggerLabel={`${currentFillOpacity}%`}\n onChange={(next) => setFillOpacity(Number(next))}\n />\n </StyledPropRow>\n </StyledFieldGrid>\n </StyledPropGroup>\n ) : null}\n\n {traits.stroke && shape ? (\n <StyledPropGroup>\n <Body2 weight=\"bold\" className=\"group-title\">\n Stroke\n </Body2>\n <StyledPropRow>\n <Label size=\"small\" weight=\"regular\">\n Pattern\n </Label>\n <StyledSegmented>\n <ChooseV2\n required\n options={BORDER_STYLE_OPTIONS.map((option) => ({\n id: option.label,\n name: option.label,\n }))}\n selected={[\n BORDER_STYLE_OPTIONS.find(\n (option) => option.value === shape.strokeDash\n )?.label ?? \"Solid\",\n ]}\n onChange={(selected) =>\n updateShape({\n strokeDash: BORDER_STYLE_OPTIONS.find(\n (option) => option.label === selected[0]\n )?.value,\n })\n }\n />\n </StyledSegmented>\n </StyledPropRow>\n <StyledFieldGrid>\n <StyledPropRow>\n <Label size=\"small\" weight=\"regular\">\n Thickness\n </Label>\n <OptionSelect\n options={THICKNESS_OPTIONS.map((thickness) => ({\n id: thickness,\n name: `${thickness} pt`,\n }))}\n value={shape.strokeWidth}\n triggerLabel={`${shape.strokeWidth} pt`}\n onChange={(next) =>\n updateShape({ strokeWidth: Number(next) })\n }\n />\n </StyledPropRow>\n <StyledPropRow>\n <Label size=\"small\" weight=\"regular\">\n Color\n </Label>\n <ColorPickerField\n value={shape.stroke}\n onSelect={(color) => updateShape({ stroke: color })}\n />\n </StyledPropRow>\n </StyledFieldGrid>\n <StyledFieldGrid>\n <StyledPropRow>\n <Label size=\"small\" weight=\"regular\">\n Radius\n </Label>\n <OptionSelect\n options={RADIUS_OPTIONS.map((radius) => ({\n id: radius,\n name: `${radius} px`,\n }))}\n value={shape.borderRadius}\n triggerLabel={`${shape.borderRadius} px`}\n onChange={(next) =>\n updateShape({ borderRadius: Number(next) })\n }\n />\n </StyledPropRow>\n <StyledPropRow>\n <Label size=\"small\" weight=\"regular\">\n Opacity\n </Label>\n <OptionSelect\n options={OPACITY_OPTIONS.map((opacity) => ({\n id: opacity,\n name: `${opacity}%`,\n }))}\n value={shape.strokeOpacity}\n triggerLabel={`${shape.strokeOpacity}%`}\n onChange={(next) =>\n updateShape({ strokeOpacity: Number(next) })\n }\n />\n </StyledPropRow>\n </StyledFieldGrid>\n </StyledPropGroup>\n ) : null}\n\n {traits.text ? (\n <StyledPropGroup>\n <Body2 weight=\"bold\" className=\"group-title\">\n Text\n </Body2>\n <StyledFieldGrid>\n <StyledPropRow>\n <Label size=\"small\" weight=\"regular\">\n Style\n </Label>\n <StyledSegmented>\n {STYLE_OPTIONS.map((option) => (\n <Tooltip key={option.key} title={option.label}>\n <IconButton\n variant=\"text gray\"\n active={styleFlags[option.key]}\n aria-label={option.label}\n onClick={() => toggleStyle(option.key)}\n >\n {option.icon}\n </IconButton>\n </Tooltip>\n ))}\n </StyledSegmented>\n </StyledPropRow>\n <StyledPropRow>\n <Label size=\"small\" weight=\"regular\">\n Size\n </Label>\n <OptionSelect\n options={FONT_SIZE_OPTIONS.map((fontSize) => ({\n id: fontSize,\n name: `${fontSize} pt`,\n }))}\n value={currentFontSize}\n triggerLabel={`${currentFontSize} pt`}\n onChange={(next) => setFontSize(Number(next))}\n />\n </StyledPropRow>\n </StyledFieldGrid>\n <StyledPropRow>\n <Label size=\"small\" weight=\"regular\">\n Alignment\n </Label>\n <StyledSegmented>\n {ALIGN_OPTIONS.map((option) => (\n <Tooltip key={option.value} title={option.label}>\n <IconButton\n variant=\"text gray\"\n active={currentAlign === option.value}\n aria-label={option.label}\n onClick={() => setAlign(option.value)}\n >\n {option.icon}\n </IconButton>\n </Tooltip>\n ))}\n </StyledSegmented>\n </StyledPropRow>\n </StyledPropGroup>\n ) : null}\n </>\n )\n );\n};\n"],"mappings":";AAAA,OAAOA,KAAK,IAA6BC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AAE7E,OAAOC,MAAM,MA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6K,eAAgB;IACvBpJ,YAAY,EAAKoJ,eAAe,QAAM;IACtC/J,QAAQ,EAAGC,IAAI,IAAKkK,WAAW,CAACjK,MAAM,CAACD,IAAI,CAAC;EAAE,CAC/C,CACY,CACA,CAAC,eAClB9F,KAAA,CAAAmF,aAAA,CAACd,aAAa,qBACZrE,KAAA,CAAAmF,aAAA,CAAClD,KAAK;IAACmD,IAAI,EAAC,OAAO;IAACC,MAAM,EAAC;EAAS,GAAC,WAE9B,CAAC,eACRrF,KAAA,CAAAmF,aAAA,CAACR,eAAe,QACb9D,aAAa,CAAC+N,GAAG,CAAEpH,MAAM,iBACxBxH,KAAA,CAAAmF,aAAA,CAAC/C,OAAO;IAACgO,GAAG,EAAE5I,MAAM,CAACzC,KAAM;IAACoM,KAAK,EAAE3J,MAAM,CAAC1C;EAAM,gBAC9C9E,KAAA,CAAAmF,aAAA,CAAC1D,UAAU;IACTyM,OAAO,EAAC,WAAW;IACnBkD,MAAM,EAAEtB,YAAY,KAAKtI,MAAM,CAACzC,KAAM;IACtC,cAAYyC,MAAM,CAAC1C,KAAM;IACzBuM,OAAO,EAAEA,CAAA,KAAMpB,QAAQ,CAACzI,MAAM,CAACzC,KAAK;EAAE,GAErCyC,MAAM,CAACuG,IACE,CACL,CACV,CACc,CACJ,CACA,CAAC,GAChB,IACJ,CACJ,CACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,97 @@
1
+ import React, { ReactElement } from "react";
2
+ import { ShapeTool } from "./bottomDock";
3
+ import { IStackedCardProps } from "../../components/StackedCard";
4
+ import { LinkDisplay, MockLink } from "../stackedCard/content";
5
+ /**
6
+ * The only canvas element here built on the shipped design-system
7
+ * `StackedCard`. The shell is hollow, so the board supplies the visual state
8
+ * (`selected`) and the width, and the content comes from `LinkCard` — which
9
+ * renders the unfurl lifecycle, not a static layout.
10
+ *
11
+ * Link cards are AUTO-HEIGHT. The host sets the width; the height follows the
12
+ * content. That is why drawing a box commits only its width, and why resizing
13
+ * is width-only.
14
+ */
15
+ export declare const CARD_MIN_WIDTH = 180;
16
+ export declare const CARD_MAX_WIDTH = 420;
17
+ export declare const CARD_DRAW_THRESHOLD = 8;
18
+ export declare const clampCardWidth: (width: number) => number;
19
+ export declare const LINK_DEFAULT_WIDTH = 260;
20
+ export declare const isValidLinkUrl: (value: string) => boolean;
21
+ export declare const linkDomain: (url: string) => string;
22
+ export declare const LINK_PALETTE: string[];
23
+ export declare const linkColor: (domain: string, offset: number) => string;
24
+ export declare const KNOWN_LINKS: MockLink[];
25
+ /**
26
+ * The fake "server" response for a URL — what `GET /link-previews/...` would
27
+ * eventually hold. Known hosts get their seed; anything else resolves to a
28
+ * generic article keyed off its own domain, so pasting an arbitrary link still
29
+ * produces a believable card instead of an empty one.
30
+ */
31
+ export declare const resolveMockLink: (url: string) => MockLink;
32
+ export declare const PRIVATE_HOST: RegExp;
33
+ export declare const isUnfurlable: (domain: string) => boolean;
34
+ /** A link element on the board. Position lives in the shared positions map. */
35
+ export interface LinkElementDef {
36
+ id: string;
37
+ width: number;
38
+ /** null while the card is an empty placeholder waiting for a URL. */
39
+ url: string | null;
40
+ }
41
+ export declare const LINK_DISPLAY: LinkDisplay;
42
+ export declare const StyledLinkCard: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<IStackedCardProps & React.RefAttributes<HTMLDivElement>>, any, {}, never>;
43
+ export declare const StyledLinkEditArea: import("styled-components").StyledComponent<"div", any, {}, never>;
44
+ export declare const StyledLinkInput: import("styled-components").StyledComponent<"input", any, {
45
+ $invalid?: boolean;
46
+ }, never>;
47
+ export declare const StyledLinkHint: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<import("../..").ICaptionProps & Omit<import("../../components/Typography/Typography").ITypographyProps, "variant" | "weight"> & React.RefAttributes<HTMLDivElement>>, any, {}, never>;
48
+ export declare const StyledShapePreview: import("styled-components").StyledComponent<"div", any, {}, never>;
49
+ export declare const shapePreviewGlyph: (tool: ShapeTool, width: number, height: number) => ReactElement;
50
+ export declare const StyledLinkDraft: import("styled-components").StyledComponent<"div", any, {}, never>;
51
+ export interface LinkFormattingToolbarProps {
52
+ url: string;
53
+ onEditUrl: () => void;
54
+ onDelete: () => void;
55
+ }
56
+ export declare const LinkFormattingToolbar: ({ url, onEditUrl, onDelete, }: LinkFormattingToolbarProps) => ReactElement;
57
+ /**
58
+ * The card's three resize callbacks, handed down untouched from the board. The
59
+ * grip reports deltas measured from the gesture START and brackets the stream
60
+ * with a start and a commit, so a card is only a conduit — the board resolves
61
+ * what a delta means.
62
+ */
63
+ export type CardResizeHandlers = Pick<IStackedCardProps, "onResizeStart" | "onResizeDelta" | "onResizeCommit">;
64
+ export interface LinkPreviewCardProps {
65
+ element: LinkElementDef;
66
+ selected: boolean;
67
+ resize: CardResizeHandlers;
68
+ onEditUrl: () => void;
69
+ onDelete: () => void;
70
+ }
71
+ /**
72
+ * A link element with a committed URL: the card runs the unfurl lifecycle.
73
+ *
74
+ * One controller per card, and the seed is memoized on the URL so the board's
75
+ * own re-renders (drag, selection, a grid change) never restart the ladder.
76
+ */
77
+ export declare const LinkPreviewCard: ({ element, selected, resize, onEditUrl, onDelete, }: LinkPreviewCardProps) => ReactElement;
78
+ export interface LinkElementProps {
79
+ element: LinkElementDef;
80
+ selected: boolean;
81
+ /** Open the editor as soon as a freshly drawn placeholder lands. */
82
+ autoEdit: boolean;
83
+ onCommitUrl: (url: string) => void;
84
+ resize: CardResizeHandlers;
85
+ onDelete: () => void;
86
+ }
87
+ /**
88
+ * The three phases of a link element:
89
+ *
90
+ * placeholder drawn but empty — an interactive invitation, distinct from the
91
+ * loading skeleton (spec §5)
92
+ * editing the inline URL field, with the shell's `entered` ring and drag
93
+ * switched off
94
+ * preview a URL is committed; the unfurl lifecycle takes over
95
+ */
96
+ export declare const LinkElement: ({ element, selected, autoEdit, onCommitUrl, resize, onDelete, }: LinkElementProps) => ReactElement;
97
+ //# sourceMappingURL=linkElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linkEl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WAAW,GAAI,iEAOzB,gBAAgB,KAAG,YAsFrB,CAAC"}
@@ -0,0 +1,327 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import React, { useEffect, useMemo } from "react";
3
+ import styled from "styled-components";
4
+ import { SELECTION_BLUE, StyledFormattingToolbar, StyledToolbarButton, StyledToolbarLink, stopClick } from "./elements";
5
+ import { InsertLinkIcon, OpenExpandedIcon, TrashIcon } from "../../components/Icons";
6
+ import { StackedCard } from "../../components/StackedCard";
7
+ import { Tooltip } from "../../components/Tooltip";
8
+ import { Caption2 } from "../../components/Typography";
9
+ import { LinkCard, LinkPlaceholder, MOCK_LINKS, useUnfurl } from "../stackedCard/content";
10
+ import { useInlineEdit } from "../stackedCard/useInlineEdit";
11
+ import linkCoverPhoto from "../static/stacked-card-cover.png";
12
+ import linkHeroPhoto from "../static/stacked-card-hero.png";
13
+
14
+ /* ------------------------------------------------------------------ */
15
+ /* Link element — StackedCard + the URL unfurl lifecycle */
16
+ /* ------------------------------------------------------------------ */
17
+
18
+ /**
19
+ * The only canvas element here built on the shipped design-system
20
+ * `StackedCard`. The shell is hollow, so the board supplies the visual state
21
+ * (`selected`) and the width, and the content comes from `LinkCard` — which
22
+ * renders the unfurl lifecycle, not a static layout.
23
+ *
24
+ * Link cards are AUTO-HEIGHT. The host sets the width; the height follows the
25
+ * content. That is why drawing a box commits only its width, and why resizing
26
+ * is width-only.
27
+ */
28
+
29
+ /* Width bounds shared by every drawn card (link, file). */
30
+ export const CARD_MIN_WIDTH = 180;
31
+ export const CARD_MAX_WIDTH = 420;
32
+
33
+ /* Below this the drag reads as a click, not a drawn box. */
34
+ export const CARD_DRAW_THRESHOLD = 8;
35
+ export const clampCardWidth = width => Math.min(CARD_MAX_WIDTH, Math.max(CARD_MIN_WIDTH, Math.round(width)));
36
+ export const LINK_DEFAULT_WIDTH = 260;
37
+
38
+ /* A shape check, nothing more. The real validation is server-side: the backend
39
+ normalizes the URL, refuses anything but http(s), blocks private address
40
+ space and re-checks every redirect hop. */
41
+ export const isValidLinkUrl = value => /^https?:\/\/[^\s/?#]+\.[^\s]*$/i.test(value.trim());
42
+
43
+ /* https://www.example.com/a?b → example.com */
44
+ export const linkDomain = url => url.trim().replace(/^https?:\/\//i, "").split(/[/?#]/)[0].replace(/^www\./i, "");
45
+
46
+ /* Stand-in favicon / hero colours. A real unfurl stores the fetched favicon and
47
+ OpenGraph image as attachments; here the colour is derived from the domain so
48
+ every pasted host keeps a stable identity instead of sharing one colour. */
49
+ export const LINK_PALETTE = ["#0F6E56", "#8C5A2B", "#2F5DA8", "#8A3E6B", "#3F6B25", "#A8452F"];
50
+ export const linkColor = (domain, offset) => {
51
+ let hash = 0;
52
+ for (let index = 0; index < domain.length; index += 1) {
53
+ hash = (hash * 31 + domain.charCodeAt(index)) % 997;
54
+ }
55
+ return LINK_PALETTE[(hash + offset) % LINK_PALETTE.length];
56
+ };
57
+
58
+ /* Hand-written seeds for the hosts worth demoing. Vimeo resolves to a playable
59
+ video with a real cover image; the history link deliberately resolves without
60
+ one, so the colour-cover fallback (a link whose page carries no OpenGraph
61
+ image) is on the board too. */
62
+ export const KNOWN_LINKS = [_extends({}, MOCK_LINKS.vimeo, {
63
+ heroSrc: linkHeroPhoto
64
+ }), _extends({}, MOCK_LINKS.history)];
65
+
66
+ /**
67
+ * The fake "server" response for a URL — what `GET /link-previews/...` would
68
+ * eventually hold. Known hosts get their seed; anything else resolves to a
69
+ * generic article keyed off its own domain, so pasting an arbitrary link still
70
+ * produces a believable card instead of an empty one.
71
+ */
72
+ export const resolveMockLink = url => {
73
+ const domain = linkDomain(url);
74
+ const known = KNOWN_LINKS.find(link => linkDomain(link.url) === domain);
75
+ if (known) {
76
+ return _extends({}, known, {
77
+ url
78
+ });
79
+ }
80
+ return {
81
+ url,
82
+ domain,
83
+ faviconColor: linkColor(domain, 0),
84
+ heroColor: linkColor(domain, 3),
85
+ heroSrc: linkCoverPhoto,
86
+ title: domain + " \u2014 the title a real unfurl reads from og:title",
87
+ description: "The summary an unfurl takes from og:description, falling back to the page's meta description when the site carries no OpenGraph tags.",
88
+ kind: "Article",
89
+ playable: false
90
+ };
91
+ };
92
+
93
+ /* Private address space — the one class of URL that passes a shape check and
94
+ still can never resolve, because the server refuses to fetch it (and re-checks
95
+ every redirect hop). Pasting one of these is how the error rung of the ladder
96
+ is reachable from the board. */
97
+ export const PRIVATE_HOST = /^(?:10|127|192\.168|169\.254|172\.(?:1[6-9]|2\d|3[01]))\./;
98
+ export const isUnfurlable = domain => !PRIVATE_HOST.test(domain);
99
+
100
+ /** A link element on the board. Position lives in the shared positions map. */
101
+
102
+ /* On the canvas a link is always the expanded card — hero, then the tinted
103
+ footer band with the domain, title and description. Compact is a column-view
104
+ density, so the board pins the level and shows no display switch. */
105
+ export const LINK_DISPLAY = "expanded";
106
+
107
+ /* The card fills the element box the board drew; the shell's reference 260px
108
+ width gives way to the host. Height stays auto. */
109
+ export const StyledLinkCard = styled(StackedCard).withConfig({
110
+ displayName: "linkElement__StyledLinkCard",
111
+ componentId: "sc-1e6iu71-0"
112
+ })(["&&{width:100%;}user-select:none;"]);
113
+
114
+ /* The inline URL editor — the placeholder's interactive half. */
115
+ export const StyledLinkEditArea = styled.div.withConfig({
116
+ displayName: "linkElement__StyledLinkEditArea",
117
+ componentId: "sc-1e6iu71-1"
118
+ })(["display:flex;flex-direction:column;gap:6px;padding:16px 12px;"]);
119
+ export const StyledLinkInput = styled.input.withConfig({
120
+ displayName: "linkElement__StyledLinkInput",
121
+ componentId: "sc-1e6iu71-2"
122
+ })(["width:100%;box-sizing:border-box;padding:8px 10px;border:1.5px solid ", ";border-radius:6px;background:var(--page-paper-main);color:var(--color-theme-900);font-family:-apple-system,BlinkMacSystemFont,\"Roboto\",\"Helvetica Neue\",Arial,sans-serif;font-size:13px;text-align:center;outline:none;&::placeholder{color:var(--color-theme-500);}"], _ref => {
123
+ let $invalid = _ref.$invalid;
124
+ return $invalid ? "var(--red-alert)" : "var(--sc-selection-ring)";
125
+ });
126
+ export const StyledLinkHint = styled(Caption2).withConfig({
127
+ displayName: "linkElement__StyledLinkHint",
128
+ componentId: "sc-1e6iu71-3"
129
+ })(["display:block;text-align:center;color:var(--red-alert);"]);
130
+
131
+ /* The dashed rubber band drawn while the Link tool is armed. The width readout
132
+ is the honest signal: the box sets the card's width, the height is the
133
+ card's own business. */
134
+ /* The outline the app's ShapePreview draws — stroke only, the selection blue,
135
+ at 70% — used both for the shape rubber band and the hover preview. */
136
+ export const StyledShapePreview = styled.div.withConfig({
137
+ displayName: "linkElement__StyledShapePreview",
138
+ componentId: "sc-1e6iu71-4"
139
+ })(["position:absolute;box-sizing:border-box;pointer-events:none;svg{display:block;overflow:visible;fill:none;stroke:", ";stroke-width:2;opacity:0.7;}"], SELECTION_BLUE);
140
+ export const shapePreviewGlyph = (tool, width, height) => /*#__PURE__*/React.createElement("svg", {
141
+ width: "100%",
142
+ height: "100%"
143
+ }, tool === "circle" ? /*#__PURE__*/React.createElement("ellipse", {
144
+ cx: "50%",
145
+ cy: "50%",
146
+ rx: "50%",
147
+ ry: "50%"
148
+ }) : null, tool === "roundedRectangle" ? /*#__PURE__*/React.createElement("rect", {
149
+ x: "0",
150
+ y: "0",
151
+ width: "100%",
152
+ height: "100%",
153
+ rx: 8,
154
+ ry: 8
155
+ }) : null, tool === "triangle" ? /*#__PURE__*/React.createElement("polygon", {
156
+ points: width / 2 + ",0 " + width + "," + height + " 0," + height
157
+ }) : null);
158
+ export const StyledLinkDraft = styled.div.withConfig({
159
+ displayName: "linkElement__StyledLinkDraft",
160
+ componentId: "sc-1e6iu71-5"
161
+ })(["position:absolute;box-sizing:border-box;border:1.5px dashed ", ";border-radius:8px;background-color:rgba(59,130,246,0.08);pointer-events:none;.draft-width{position:absolute;top:-22px;left:0;padding:1px 6px;border-radius:4px;background-color:", ";color:#ffffff;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;white-space:nowrap;}"], SELECTION_BLUE, SELECTION_BLUE);
162
+ /* The link element's floating toolbar. It acts on the ENTITY: go to the page,
163
+ change which page, or bin the card. */
164
+ export const LinkFormattingToolbar = _ref2 => {
165
+ let url = _ref2.url,
166
+ onEditUrl = _ref2.onEditUrl,
167
+ onDelete = _ref2.onDelete;
168
+ return /*#__PURE__*/React.createElement(StyledFormattingToolbar, {
169
+ onMouseDown: stopClick,
170
+ onClick: stopClick
171
+ }, /*#__PURE__*/React.createElement(StyledToolbarLink, {
172
+ href: url,
173
+ target: "_blank",
174
+ rel: "noopener noreferrer"
175
+ }, /*#__PURE__*/React.createElement(OpenExpandedIcon, {
176
+ className: "i16"
177
+ }), "Visit"), /*#__PURE__*/React.createElement(StyledToolbarButton, {
178
+ type: "button",
179
+ onClick: onEditUrl
180
+ }, /*#__PURE__*/React.createElement(InsertLinkIcon, {
181
+ className: "i16"
182
+ }), "Edit"), /*#__PURE__*/React.createElement("span", {
183
+ className: "divider"
184
+ }), /*#__PURE__*/React.createElement(Tooltip, {
185
+ title: "Move to Trash"
186
+ }, /*#__PURE__*/React.createElement(StyledToolbarButton, {
187
+ type: "button",
188
+ className: "icon-only",
189
+ onClick: onDelete
190
+ }, /*#__PURE__*/React.createElement(TrashIcon, {
191
+ className: "i16"
192
+ }))));
193
+ };
194
+
195
+ /**
196
+ * The card's three resize callbacks, handed down untouched from the board. The
197
+ * grip reports deltas measured from the gesture START and brackets the stream
198
+ * with a start and a commit, so a card is only a conduit — the board resolves
199
+ * what a delta means.
200
+ */
201
+
202
+ /**
203
+ * A link element with a committed URL: the card runs the unfurl lifecycle.
204
+ *
205
+ * One controller per card, and the seed is memoized on the URL so the board's
206
+ * own re-renders (drag, selection, a grid change) never restart the ladder.
207
+ */
208
+ export const LinkPreviewCard = _ref3 => {
209
+ var _element$url;
210
+ let element = _ref3.element,
211
+ selected = _ref3.selected,
212
+ resize = _ref3.resize,
213
+ onEditUrl = _ref3.onEditUrl,
214
+ onDelete = _ref3.onDelete;
215
+ const url = (_element$url = element.url) != null ? _element$url : "";
216
+ const link = useMemo(() => resolveMockLink(url), [url]);
217
+ const unfurl = useUnfurl({
218
+ link,
219
+ delayMs: 700,
220
+ shouldFail: !isUnfurlable(link.domain)
221
+ });
222
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledLinkCard, _extends({
223
+ selected: selected,
224
+ resizable: selected,
225
+ resizeAxis: "width",
226
+ resizeLabel: "Resize link card"
227
+ }, resize), /*#__PURE__*/React.createElement(LinkCard, {
228
+ unfurl: unfurl,
229
+ display: LINK_DISPLAY
230
+ })), selected ? /*#__PURE__*/React.createElement(LinkFormattingToolbar, {
231
+ url: url,
232
+ onEditUrl: onEditUrl,
233
+ onDelete: onDelete
234
+ }) : null);
235
+ };
236
+ /**
237
+ * The three phases of a link element:
238
+ *
239
+ * placeholder drawn but empty — an interactive invitation, distinct from the
240
+ * loading skeleton (spec §5)
241
+ * editing the inline URL field, with the shell's `entered` ring and drag
242
+ * switched off
243
+ * preview a URL is committed; the unfurl lifecycle takes over
244
+ */
245
+ export const LinkElement = _ref4 => {
246
+ let element = _ref4.element,
247
+ selected = _ref4.selected,
248
+ autoEdit = _ref4.autoEdit,
249
+ onCommitUrl = _ref4.onCommitUrl,
250
+ resize = _ref4.resize,
251
+ onDelete = _ref4.onDelete;
252
+ const edit = useInlineEdit({
253
+ validate: value => isValidLinkUrl(value) ? true : "Enter a valid link, e.g. https://…",
254
+ onCommit: value => onCommitUrl(value.trim())
255
+ });
256
+ const begin = edit.begin;
257
+
258
+ // A box drawn with the Link tool is a request to add a link, so the editor
259
+ // opens straight away; the placeholder is what a cancelled edit falls back to.
260
+ useEffect(() => {
261
+ if (autoEdit) {
262
+ begin();
263
+ }
264
+ }, [autoEdit, begin]);
265
+
266
+ /* Editing wins over the preview, so the same editor serves the first fill and
267
+ every later correction: "Edit link" seeds the field with the current URL
268
+ and Esc drops back to the card that was already there. */
269
+ if (edit.editing) {
270
+ return /*#__PURE__*/React.createElement(StyledLinkCard, {
271
+ entered: true,
272
+ draggable: false,
273
+ "aria-label": "Add a link"
274
+ }, /*#__PURE__*/React.createElement(StyledLinkEditArea, null, /*#__PURE__*/React.createElement(StyledLinkInput, _extends({}, edit.bind, {
275
+ type: "text",
276
+ inputMode: "url",
277
+ placeholder: "https://\u2026",
278
+ $invalid: edit.error != null
279
+ })), edit.error ? /*#__PURE__*/React.createElement(StyledLinkHint, {
280
+ role: "alert"
281
+ }, edit.error) : /*#__PURE__*/React.createElement(Caption2, {
282
+ color: "tertiary",
283
+ style: {
284
+ textAlign: "center"
285
+ }
286
+ }, "Enter to add \xB7 Esc to cancel")));
287
+ }
288
+ if (element.url != null) {
289
+ return /*#__PURE__*/React.createElement(LinkPreviewCard, {
290
+ element: element,
291
+ selected: selected,
292
+ resize: resize,
293
+ onEditUrl: () => {
294
+ var _element$url2;
295
+ edit.reset((_element$url2 = element.url) != null ? _element$url2 : "");
296
+ edit.begin();
297
+ },
298
+ onDelete: onDelete
299
+ });
300
+ }
301
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledLinkCard, {
302
+ selected: selected,
303
+ "aria-label": "Empty link card"
304
+ }, /*#__PURE__*/React.createElement(LinkPlaceholder, {
305
+ "data-drag-through": "",
306
+ onClick: edit.begin
307
+ })), selected ? /*#__PURE__*/React.createElement(StyledFormattingToolbar, {
308
+ onMouseDown: stopClick,
309
+ onClick: stopClick
310
+ }, /*#__PURE__*/React.createElement(StyledToolbarButton, {
311
+ type: "button",
312
+ onClick: edit.begin
313
+ }, /*#__PURE__*/React.createElement(InsertLinkIcon, {
314
+ className: "i16"
315
+ }), "Edit"), /*#__PURE__*/React.createElement("span", {
316
+ className: "divider"
317
+ }), /*#__PURE__*/React.createElement(Tooltip, {
318
+ title: "Move to Trash"
319
+ }, /*#__PURE__*/React.createElement(StyledToolbarButton, {
320
+ type: "button",
321
+ className: "icon-only",
322
+ onClick: onDelete
323
+ }, /*#__PURE__*/React.createElement(TrashIcon, {
324
+ className: "i16"
325
+ })))) : null);
326
+ };
327
+ //# sourceMappingURL=linkElement.js.map