@activecollab/components 2.0.588 → 2.0.590
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/CommandPalette/CommandPalette.js +90 -62
- package/dist/cjs/components/CommandPalette/CommandPalette.js.map +1 -1
- package/dist/cjs/components/CommandPalette/CommandPalette.styles.js +34 -16
- package/dist/cjs/components/CommandPalette/CommandPalette.styles.js.map +1 -1
- package/dist/cjs/components/CommandPalette/CommandPaletteCommandItem.js +1 -0
- package/dist/cjs/components/CommandPalette/CommandPaletteCommandItem.js.map +1 -1
- package/dist/cjs/components/CommandPalette/CommandPaletteHeader.js +40 -9
- package/dist/cjs/components/CommandPalette/CommandPaletteHeader.js.map +1 -1
- package/dist/cjs/components/CommandPalette/CommandPaletteItem.js +13 -4
- package/dist/cjs/components/CommandPalette/CommandPaletteItem.js.map +1 -1
- package/dist/cjs/components/CommandPalette/CommandPaletteVirtualList.js +125 -0
- package/dist/cjs/components/CommandPalette/CommandPaletteVirtualList.js.map +1 -0
- package/dist/cjs/components/CommandPalette/context/SelectedContext.js.map +1 -1
- package/dist/cjs/components/GlobalStyle.js +1 -1
- package/dist/cjs/components/GlobalStyle.js.map +1 -1
- package/dist/cjs/components/ObjectLayout/ObjectLayout.js +5 -1
- package/dist/cjs/components/ObjectLayout/ObjectLayout.js.map +1 -1
- package/dist/cjs/components/ObjectLayout/Styles.js +17 -10
- package/dist/cjs/components/ObjectLayout/Styles.js.map +1 -1
- package/dist/cjs/components/PropertyList/PropertyList.js +12 -1
- package/dist/cjs/components/PropertyList/PropertyList.js.map +1 -1
- package/dist/cjs/components/PropertyList/Styles.js +58 -51
- package/dist/cjs/components/PropertyList/Styles.js.map +1 -1
- package/dist/cjs/components/Section/Section.js +4 -1
- package/dist/cjs/components/Section/Section.js.map +1 -1
- package/dist/cjs/components/Section/Styles.js +7 -3
- package/dist/cjs/components/Section/Styles.js.map +1 -1
- package/dist/cjs/components/TicketPerforation/TicketPerforation.js +7 -5
- package/dist/cjs/components/TicketPerforation/TicketPerforation.js.map +1 -1
- package/dist/cjs/presentation/whiteboard/elementToolbars.js +192 -1
- package/dist/cjs/presentation/whiteboard/elementToolbars.js.map +1 -1
- package/dist/cjs/presentation/whiteboard/inspector.js +6 -1
- package/dist/cjs/presentation/whiteboard/inspector.js.map +1 -1
- package/dist/cjs/presentation/whiteboard/lineElements.js +982 -0
- package/dist/cjs/presentation/whiteboard/lineElements.js.map +1 -0
- package/dist/cjs/presentation/whiteboard/lineInspector.js +301 -0
- package/dist/cjs/presentation/whiteboard/lineInspector.js.map +1 -0
- package/dist/cjs/presentation/whiteboard/lineModel.js +596 -0
- package/dist/cjs/presentation/whiteboard/lineModel.js.map +1 -0
- package/dist/cjs/presentation/whiteboard/outline.js +31 -12
- package/dist/cjs/presentation/whiteboard/outline.js.map +1 -1
- package/dist/cjs/presentation/whiteboardModern/toolDock.js +11 -17
- package/dist/cjs/presentation/whiteboardModern/toolDock.js.map +1 -1
- package/dist/esm/components/CommandPalette/CommandPalette.d.ts +13 -3
- package/dist/esm/components/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/esm/components/CommandPalette/CommandPalette.js +77 -53
- package/dist/esm/components/CommandPalette/CommandPalette.js.map +1 -1
- package/dist/esm/components/CommandPalette/CommandPalette.styles.d.ts +9 -2
- package/dist/esm/components/CommandPalette/CommandPalette.styles.d.ts.map +1 -1
- package/dist/esm/components/CommandPalette/CommandPalette.styles.js +30 -14
- package/dist/esm/components/CommandPalette/CommandPalette.styles.js.map +1 -1
- package/dist/esm/components/CommandPalette/CommandPaletteCommandItem.d.ts.map +1 -1
- package/dist/esm/components/CommandPalette/CommandPaletteCommandItem.js +1 -0
- package/dist/esm/components/CommandPalette/CommandPaletteCommandItem.js.map +1 -1
- package/dist/esm/components/CommandPalette/CommandPaletteHeader.d.ts +3 -1
- package/dist/esm/components/CommandPalette/CommandPaletteHeader.d.ts.map +1 -1
- package/dist/esm/components/CommandPalette/CommandPaletteHeader.js +40 -9
- package/dist/esm/components/CommandPalette/CommandPaletteHeader.js.map +1 -1
- package/dist/esm/components/CommandPalette/CommandPaletteItem.d.ts +7 -1
- package/dist/esm/components/CommandPalette/CommandPaletteItem.d.ts.map +1 -1
- package/dist/esm/components/CommandPalette/CommandPaletteItem.js +14 -5
- package/dist/esm/components/CommandPalette/CommandPaletteItem.js.map +1 -1
- package/dist/esm/components/CommandPalette/CommandPaletteVirtualList.d.ts +21 -0
- package/dist/esm/components/CommandPalette/CommandPaletteVirtualList.d.ts.map +1 -0
- package/dist/esm/components/CommandPalette/CommandPaletteVirtualList.js +104 -0
- package/dist/esm/components/CommandPalette/CommandPaletteVirtualList.js.map +1 -0
- package/dist/esm/components/CommandPalette/context/SelectedContext.d.ts +5 -0
- package/dist/esm/components/CommandPalette/context/SelectedContext.d.ts.map +1 -1
- package/dist/esm/components/CommandPalette/context/SelectedContext.js.map +1 -1
- package/dist/esm/components/GlobalStyle.d.ts.map +1 -1
- package/dist/esm/components/GlobalStyle.js +1 -1
- package/dist/esm/components/GlobalStyle.js.map +1 -1
- package/dist/esm/components/ObjectLayout/ObjectLayout.d.ts +2 -0
- package/dist/esm/components/ObjectLayout/ObjectLayout.d.ts.map +1 -1
- package/dist/esm/components/ObjectLayout/ObjectLayout.js +5 -1
- package/dist/esm/components/ObjectLayout/ObjectLayout.js.map +1 -1
- package/dist/esm/components/ObjectLayout/Styles.d.ts +1 -0
- package/dist/esm/components/ObjectLayout/Styles.d.ts.map +1 -1
- package/dist/esm/components/ObjectLayout/Styles.js +16 -9
- package/dist/esm/components/ObjectLayout/Styles.js.map +1 -1
- package/dist/esm/components/PropertyList/PropertyList.d.ts +6 -0
- package/dist/esm/components/PropertyList/PropertyList.d.ts.map +1 -1
- package/dist/esm/components/PropertyList/PropertyList.js +12 -1
- package/dist/esm/components/PropertyList/PropertyList.js.map +1 -1
- package/dist/esm/components/PropertyList/Styles.d.ts +2 -0
- package/dist/esm/components/PropertyList/Styles.d.ts.map +1 -1
- package/dist/esm/components/PropertyList/Styles.js +58 -51
- package/dist/esm/components/PropertyList/Styles.js.map +1 -1
- package/dist/esm/components/Section/Section.d.ts +2 -0
- package/dist/esm/components/Section/Section.d.ts.map +1 -1
- package/dist/esm/components/Section/Section.js +4 -1
- package/dist/esm/components/Section/Section.js.map +1 -1
- package/dist/esm/components/Section/Styles.d.ts +3 -1
- package/dist/esm/components/Section/Styles.d.ts.map +1 -1
- package/dist/esm/components/Section/Styles.js +6 -2
- package/dist/esm/components/Section/Styles.js.map +1 -1
- package/dist/esm/components/TicketPerforation/TicketPerforation.d.ts +2 -0
- package/dist/esm/components/TicketPerforation/TicketPerforation.d.ts.map +1 -1
- package/dist/esm/components/TicketPerforation/TicketPerforation.js +7 -5
- package/dist/esm/components/TicketPerforation/TicketPerforation.js.map +1 -1
- package/dist/esm/presentation/whiteboard/elementToolbars.d.ts +22 -0
- package/dist/esm/presentation/whiteboard/elementToolbars.d.ts.map +1 -1
- package/dist/esm/presentation/whiteboard/elementToolbars.js +151 -2
- package/dist/esm/presentation/whiteboard/elementToolbars.js.map +1 -1
- package/dist/esm/presentation/whiteboard/inspector.d.ts +10 -2
- package/dist/esm/presentation/whiteboard/inspector.d.ts.map +1 -1
- package/dist/esm/presentation/whiteboard/inspector.js +6 -2
- package/dist/esm/presentation/whiteboard/inspector.js.map +1 -1
- package/dist/esm/presentation/whiteboard/lineElements.d.ts +23 -0
- package/dist/esm/presentation/whiteboard/lineElements.d.ts.map +1 -0
- package/dist/esm/presentation/whiteboard/lineElements.js +851 -0
- package/dist/esm/presentation/whiteboard/lineElements.js.map +1 -0
- package/dist/esm/presentation/whiteboard/lineInspector.d.ts +9 -0
- package/dist/esm/presentation/whiteboard/lineInspector.d.ts.map +1 -0
- package/dist/esm/presentation/whiteboard/lineInspector.js +224 -0
- package/dist/esm/presentation/whiteboard/lineInspector.js.map +1 -0
- package/dist/esm/presentation/whiteboard/lineModel.d.ts +132 -0
- package/dist/esm/presentation/whiteboard/lineModel.d.ts.map +1 -0
- package/dist/esm/presentation/whiteboard/lineModel.js +555 -0
- package/dist/esm/presentation/whiteboard/lineModel.js.map +1 -0
- package/dist/esm/presentation/whiteboard/outline.d.ts +4 -2
- package/dist/esm/presentation/whiteboard/outline.d.ts.map +1 -1
- package/dist/esm/presentation/whiteboard/outline.js +20 -7
- package/dist/esm/presentation/whiteboard/outline.js.map +1 -1
- package/dist/esm/presentation/whiteboardModern/toolDock.d.ts +2 -2
- package/dist/esm/presentation/whiteboardModern/toolDock.d.ts.map +1 -1
- package/dist/esm/presentation/whiteboardModern/toolDock.js +12 -18
- package/dist/esm/presentation/whiteboardModern/toolDock.js.map +1 -1
- package/dist/index.js +385 -166
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Section.js","names":["React","forwardRef","useId","classnames","StyledSection","StyledSectionActions","StyledSectionCounter","StyledSectionHeader","StyledSectionTitle","Card","Section","_ref","ref","title","counter","actions","_ref$card","card","_ref$radius","radius","className","children","rest","_objectWithoutPropertiesLoose","_excluded","titleId","hasCounter","undefined","createElement","_extends","id","variant","style","displayName"],"sources":["../../../../src/components/Section/Section.tsx"],"sourcesContent":["import React, {\n CSSProperties,\n HTMLAttributes,\n ReactNode,\n forwardRef,\n useId,\n} from \"react\";\n\nimport classnames from \"classnames\";\n\nimport {\n StyledSection,\n StyledSectionActions,\n StyledSectionCounter,\n StyledSectionHeader,\n StyledSectionTitle,\n} from \"./Styles\";\nimport { Card } from \"../Card\";\n\nexport interface ISectionProps\n extends Omit<HTMLAttributes<HTMLElement>, \"title\"> {\n /** The title of the section. Without it the section has no header. */\n title?: ReactNode;\n /** A short count beside the title, for example \"9 of 15\". */\n counter?: ReactNode;\n /** Controls at the right end of the header. */\n actions?: ReactNode;\n /** Puts the body in a raised card. */\n card?: boolean;\n /** The corner radius of the card, in pixels. A ListRow with cardEdges follows it. */\n radius?: number;\n}\n\nexport const Section = forwardRef<HTMLElement, ISectionProps>(\n (\n {\n title,\n counter,\n actions,\n card = false,\n radius = 24,\n className,\n children,\n ...rest\n },\n ref\n ) => {\n const titleId = useId();\n const hasCounter = counter !== undefined && counter !== null;\n\n return (\n <StyledSection\n {...rest}\n ref={ref}\n aria-labelledby={title ? titleId : undefined}\n className={classnames(\"c-section\", className)}\n >\n {title ? (\n <StyledSectionHeader className=\"c-section__header\">\n <StyledSectionTitle id={titleId}>{title}</StyledSectionTitle>\n {hasCounter ? (\n <StyledSectionCounter className=\"c-section__counter\">\n {counter}\n </StyledSectionCounter>\n ) : null}\n {actions ? (\n <StyledSectionActions className=\"c-section__actions\">\n {actions}\n </StyledSectionActions>\n ) : null}\n </StyledSectionHeader>\n ) : null}\n {card ? (\n <Card\n variant=\"raised\"\n radius={radius}\n className=\"c-section__body\"\n style={{ \"--c-section-radius\": `${radius}px` } as CSSProperties}\n >\n {children}\n </Card>\n ) : (\n <div className=\"c-section__body\">{children}</div>\n )}\n </StyledSection>\n );\n }\n);\n\nSection.displayName = \"Section\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAIVC,UAAU,EACVC,KAAK,QACA,OAAO;AAEd,OAAOC,UAAU,MAAM,YAAY;AAEnC,SACEC,aAAa,EACbC,oBAAoB,EACpBC,oBAAoB,EACpBC,mBAAmB,EACnBC,kBAAkB,QACb,UAAU;AACjB,SAASC,IAAI,QAAQ,SAAS;
|
|
1
|
+
{"version":3,"file":"Section.js","names":["React","forwardRef","useId","classnames","StyledSection","StyledSectionActions","StyledSectionCounter","StyledSectionHeader","StyledSectionTitle","Card","Section","_ref","ref","title","counter","actions","_ref$card","card","_ref$radius","radius","_ref$solid","solid","className","children","rest","_objectWithoutPropertiesLoose","_excluded","titleId","hasCounter","undefined","createElement","_extends","$solid","id","variant","style","displayName"],"sources":["../../../../src/components/Section/Section.tsx"],"sourcesContent":["import React, {\n CSSProperties,\n HTMLAttributes,\n ReactNode,\n forwardRef,\n useId,\n} from \"react\";\n\nimport classnames from \"classnames\";\n\nimport {\n StyledSection,\n StyledSectionActions,\n StyledSectionCounter,\n StyledSectionHeader,\n StyledSectionTitle,\n} from \"./Styles\";\nimport { Card } from \"../Card\";\n\nexport interface ISectionProps\n extends Omit<HTMLAttributes<HTMLElement>, \"title\"> {\n /** The title of the section. Without it the section has no header. */\n title?: ReactNode;\n /** A short count beside the title, for example \"9 of 15\". */\n counter?: ReactNode;\n /** Controls at the right end of the header. */\n actions?: ReactNode;\n /** Puts the body in a raised card. */\n card?: boolean;\n /** The corner radius of the card, in pixels. A ListRow with cardEdges follows it. */\n radius?: number;\n /** In a flat ObjectLayout the card keeps the raised color of the theme, and its rows take the soft divider. */\n solid?: boolean;\n}\n\nexport const Section = forwardRef<HTMLElement, ISectionProps>(\n (\n {\n title,\n counter,\n actions,\n card = false,\n radius = 24,\n solid = false,\n className,\n children,\n ...rest\n },\n ref\n ) => {\n const titleId = useId();\n const hasCounter = counter !== undefined && counter !== null;\n\n return (\n <StyledSection\n {...rest}\n ref={ref}\n $solid={solid}\n aria-labelledby={title ? titleId : undefined}\n className={classnames(\"c-section\", className)}\n >\n {title ? (\n <StyledSectionHeader className=\"c-section__header\">\n <StyledSectionTitle id={titleId}>{title}</StyledSectionTitle>\n {hasCounter ? (\n <StyledSectionCounter className=\"c-section__counter\">\n {counter}\n </StyledSectionCounter>\n ) : null}\n {actions ? (\n <StyledSectionActions className=\"c-section__actions\">\n {actions}\n </StyledSectionActions>\n ) : null}\n </StyledSectionHeader>\n ) : null}\n {card ? (\n <Card\n variant=\"raised\"\n radius={radius}\n className=\"c-section__body\"\n style={{ \"--c-section-radius\": `${radius}px` } as CSSProperties}\n >\n {children}\n </Card>\n ) : (\n <div className=\"c-section__body\">{children}</div>\n )}\n </StyledSection>\n );\n }\n);\n\nSection.displayName = \"Section\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAIVC,UAAU,EACVC,KAAK,QACA,OAAO;AAEd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kB;IAACyB,EAAE,EAAEN;EAAQ,GAAEd,KAA0B,CAAC,EAC5De,UAAU,gBACT5B,KAAA,CAAA8B,aAAA,CAACxB,oBAAoB;IAACgB,SAAS,EAAC;EAAoB,GACjDR,OACmB,CAAC,GACrB,IAAI,EACPC,OAAO,gBACNf,KAAA,CAAA8B,aAAA,CAACzB,oBAAoB;IAACiB,SAAS,EAAC;EAAoB,GACjDP,OACmB,CAAC,GACrB,IACe,CAAC,GACpB,IAAI,EACPE,IAAI,gBACHjB,KAAA,CAAA8B,aAAA,CAACrB,IAAI;IACHyB,OAAO,EAAC,QAAQ;IAChBf,MAAM,EAAEA,MAAO;IACfG,SAAS,EAAC,iBAAiB;IAC3Ba,KAAK,EAAE;MAAE,oBAAoB,EAAKhB,MAAM;IAAK;EAAmB,GAE/DI,QACG,CAAC,gBAEPvB,KAAA,CAAA8B,aAAA;IAAKR,SAAS,EAAC;EAAiB,GAAEC,QAAc,CAErC,CAAC;AAEpB,CACF,CAAC;AAEDb,OAAO,CAAC0B,WAAW,GAAG,SAAS","ignoreList":[]}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export declare const StyledSection: import("styled-components").StyledComponent<"section", any, {
|
|
1
|
+
export declare const StyledSection: import("styled-components").StyledComponent<"section", any, {
|
|
2
|
+
$solid: boolean;
|
|
3
|
+
}, never>;
|
|
2
4
|
export declare const StyledSectionHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
5
|
export declare const StyledSectionTitle: import("styled-components").StyledComponent<"h3", any, {}, never>;
|
|
4
6
|
export declare const StyledSectionCounter: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Section/Styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Section/Styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa;YAA4B,OAAO;SAkB5D,CAAC;AAEF,eAAO,MAAM,mBAAmB,oEAM/B,CAAC;AAEF,eAAO,MAAM,kBAAkB,mEAM9B,CAAC;AAEF,eAAO,MAAM,oBAAoB,qEAIhC,CAAC;AAEF,eAAO,MAAM,oBAAoB,oEAKhC,CAAC"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
|
+
const SOLID_SURFACE = "var(--object-layout-card-surface, var(--surface-raised))";
|
|
2
3
|
export const StyledSection = styled.section.withConfig({
|
|
3
4
|
displayName: "Styles__StyledSection",
|
|
4
5
|
componentId: "sc-vhpgru-0"
|
|
5
|
-
})(["display:flex;flex-direction:column;gap:8px;min-width:0;"]
|
|
6
|
+
})(["display:flex;flex-direction:column;gap:8px;min-width:0;", ""], _ref => {
|
|
7
|
+
let $solid = _ref.$solid;
|
|
8
|
+
return $solid && css(["> .c-section__body{--c-section-divider:var(--object-layout-divider,var(--border-raised));background-color:", ";}> .c-section__body > *{--border-raised:var(--c-section-divider);}"], SOLID_SURFACE);
|
|
9
|
+
});
|
|
6
10
|
export const StyledSectionHeader = styled.div.withConfig({
|
|
7
11
|
displayName: "Styles__StyledSectionHeader",
|
|
8
12
|
componentId: "sc-vhpgru-1"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.js","names":["styled","StyledSection","section","withConfig","displayName","componentId","StyledSectionHeader","div","StyledSectionTitle","h3","StyledSectionCounter","span","StyledSectionActions"],"sources":["../../../../src/components/Section/Styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nexport const StyledSection = styled.section
|
|
1
|
+
{"version":3,"file":"Styles.js","names":["styled","css","SOLID_SURFACE","StyledSection","section","withConfig","displayName","componentId","_ref","$solid","StyledSectionHeader","div","StyledSectionTitle","h3","StyledSectionCounter","span","StyledSectionActions"],"sources":["../../../../src/components/Section/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nconst SOLID_SURFACE =\n \"var(--object-layout-card-surface, var(--surface-raised))\";\n\nexport const StyledSection = styled.section<{ $solid: boolean }>`\n display: flex;\n flex-direction: column;\n gap: 8px;\n min-width: 0;\n\n ${({ $solid }) =>\n $solid &&\n css`\n > .c-section__body {\n --c-section-divider: var(--object-layout-divider, var(--border-raised));\n background-color: ${SOLID_SURFACE};\n }\n\n > .c-section__body > * {\n --border-raised: var(--c-section-divider);\n }\n `}\n`;\n\nexport const StyledSectionHeader = styled.div`\n display: flex;\n align-items: center;\n gap: 8px;\n min-height: 24px;\n padding: 0 16px;\n`;\n\nexport const StyledSectionTitle = styled.h3`\n margin: 0;\n font-size: calc(16px * var(--text-scale, 1));\n line-height: 24px;\n font-weight: 600;\n color: var(--color-theme-800);\n`;\n\nexport const StyledSectionCounter = styled.span`\n font-size: calc(13px * var(--text-scale, 1));\n line-height: 20px;\n color: var(--color-theme-700);\n`;\n\nexport const StyledSectionActions = styled.div`\n display: flex;\n align-items: center;\n gap: 16px;\n margin-left: auto;\n`;\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAE/C,MAAMC,aAAa,GACjB,0DAA0D;AAE5D,OAAO,MAAMC,aAAa,GAAGH,MAAM,CAACI,OAAO,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,oEAMvCC,IAAA;EAAA,IAAGC,MAAM,GAAAD,IAAA,CAANC,MAAM;EAAA,OACTA,MAAM,IACNR,GAAG,wLAGqBC,aAAa,CAMpC;AAAA,EACJ;AAED,OAAO,MAAMQ,mBAAmB,GAAGV,MAAM,CAACW,GAAG,CAAAN,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,+EAM5C;AAED,OAAO,MAAMK,kBAAkB,GAAGZ,MAAM,CAACa,EAAE,CAAAR,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,0HAM1C;AAED,OAAO,MAAMO,oBAAoB,GAAGd,MAAM,CAACe,IAAI,CAAAV,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,iGAI9C;AAED,OAAO,MAAMS,oBAAoB,GAAGhB,MAAM,CAACW,GAAG,CAAAN,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,kEAK7C","ignoreList":[]}
|
|
@@ -4,6 +4,8 @@ export type { TicketPerforationLine };
|
|
|
4
4
|
export interface ITicketPerforationProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
5
|
/** The color of the dashed line: "primary" on a sheet, "raised" in a raised card. */
|
|
6
6
|
line?: TicketPerforationLine;
|
|
7
|
+
/** Without notches the tear is only its dashed line. */
|
|
8
|
+
notches?: boolean;
|
|
7
9
|
}
|
|
8
10
|
/** The line where a ticket tears: a dashed line with a notch in each edge of a card with a 16px padding. */
|
|
9
11
|
export declare const TicketPerforation: React.ForwardRefExoticComponent<ITicketPerforationProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TicketPerforation.d.ts","sourceRoot":"","sources":["../../../../src/components/TicketPerforation/TicketPerforation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,cAAc,EAAc,MAAM,OAAO,CAAC;AAI1D,OAAO,EAKL,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAElB,YAAY,EAAE,qBAAqB,EAAE,CAAC;AAEtC,MAAM,WAAW,uBACf,SAAQ,cAAc,CAAC,cAAc,CAAC;IACtC,qFAAqF;IACrF,IAAI,CAAC,EAAE,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"TicketPerforation.d.ts","sourceRoot":"","sources":["../../../../src/components/TicketPerforation/TicketPerforation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,cAAc,EAAc,MAAM,OAAO,CAAC;AAI1D,OAAO,EAKL,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAElB,YAAY,EAAE,qBAAqB,EAAE,CAAC;AAEtC,MAAM,WAAW,uBACf,SAAQ,cAAc,CAAC,cAAc,CAAC;IACtC,qFAAqF;IACrF,IAAI,CAAC,EAAE,qBAAqB,CAAC;IAC7B,wDAAwD;IACxD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,4GAA4G;AAC5G,eAAO,MAAM,iBAAiB,gGAsB5B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["line", "className"];
|
|
3
|
+
const _excluded = ["line", "notches", "className"];
|
|
4
4
|
import React, { forwardRef } from "react";
|
|
5
5
|
import classnames from "classnames";
|
|
6
6
|
import { StyledTicketPerforation, StyledTicketPerforationEdge, StyledTicketPerforationLine, StyledTicketPerforationNotch } from "./Styles";
|
|
@@ -8,6 +8,8 @@ import { StyledTicketPerforation, StyledTicketPerforationEdge, StyledTicketPerfo
|
|
|
8
8
|
export const TicketPerforation = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
9
9
|
let _ref$line = _ref.line,
|
|
10
10
|
line = _ref$line === void 0 ? "primary" : _ref$line,
|
|
11
|
+
_ref$notches = _ref.notches,
|
|
12
|
+
notches = _ref$notches === void 0 ? true : _ref$notches,
|
|
11
13
|
className = _ref.className,
|
|
12
14
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
13
15
|
return /*#__PURE__*/React.createElement(StyledTicketPerforation, _extends({
|
|
@@ -15,17 +17,17 @@ export const TicketPerforation = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
15
17
|
}, rest, {
|
|
16
18
|
ref: ref,
|
|
17
19
|
className: classnames("c-ticket-perforation", className)
|
|
18
|
-
}), /*#__PURE__*/React.createElement(StyledTicketPerforationEdge, {
|
|
20
|
+
}), notches ? /*#__PURE__*/React.createElement(StyledTicketPerforationEdge, {
|
|
19
21
|
$side: "left"
|
|
20
22
|
}, /*#__PURE__*/React.createElement(StyledTicketPerforationNotch, {
|
|
21
23
|
$side: "left"
|
|
22
|
-
})), /*#__PURE__*/React.createElement(StyledTicketPerforationLine, {
|
|
24
|
+
})) : null, /*#__PURE__*/React.createElement(StyledTicketPerforationLine, {
|
|
23
25
|
$line: line
|
|
24
|
-
}), /*#__PURE__*/React.createElement(StyledTicketPerforationEdge, {
|
|
26
|
+
}), notches ? /*#__PURE__*/React.createElement(StyledTicketPerforationEdge, {
|
|
25
27
|
$side: "right"
|
|
26
28
|
}, /*#__PURE__*/React.createElement(StyledTicketPerforationNotch, {
|
|
27
29
|
$side: "right"
|
|
28
|
-
})));
|
|
30
|
+
})) : null);
|
|
29
31
|
});
|
|
30
32
|
TicketPerforation.displayName = "TicketPerforation";
|
|
31
33
|
//# sourceMappingURL=TicketPerforation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TicketPerforation.js","names":["React","forwardRef","classnames","StyledTicketPerforation","StyledTicketPerforationEdge","StyledTicketPerforationLine","StyledTicketPerforationNotch","TicketPerforation","_ref","ref","_ref$line","line","className","rest","_objectWithoutPropertiesLoose","_excluded","createElement","_extends","$side","$line","displayName"],"sources":["../../../../src/components/TicketPerforation/TicketPerforation.tsx"],"sourcesContent":["import React, { HTMLAttributes, forwardRef } from \"react\";\n\nimport classnames from \"classnames\";\n\nimport {\n StyledTicketPerforation,\n StyledTicketPerforationEdge,\n StyledTicketPerforationLine,\n StyledTicketPerforationNotch,\n TicketPerforationLine,\n} from \"./Styles\";\n\nexport type { TicketPerforationLine };\n\nexport interface ITicketPerforationProps\n extends HTMLAttributes<HTMLDivElement> {\n /** The color of the dashed line: \"primary\" on a sheet, \"raised\" in a raised card. */\n line?: TicketPerforationLine;\n}\n\n/** The line where a ticket tears: a dashed line with a notch in each edge of a card with a 16px padding. */\nexport const TicketPerforation = forwardRef<\n HTMLDivElement,\n ITicketPerforationProps\n>(({ line = \"primary\", className, ...rest }, ref) => (\n <StyledTicketPerforation\n aria-hidden=\"true\"\n {...rest}\n ref={ref}\n className={classnames(\"c-ticket-perforation\", className)}\n >\n <StyledTicketPerforationEdge $side=\"left\">\n
|
|
1
|
+
{"version":3,"file":"TicketPerforation.js","names":["React","forwardRef","classnames","StyledTicketPerforation","StyledTicketPerforationEdge","StyledTicketPerforationLine","StyledTicketPerforationNotch","TicketPerforation","_ref","ref","_ref$line","line","_ref$notches","notches","className","rest","_objectWithoutPropertiesLoose","_excluded","createElement","_extends","$side","$line","displayName"],"sources":["../../../../src/components/TicketPerforation/TicketPerforation.tsx"],"sourcesContent":["import React, { HTMLAttributes, forwardRef } from \"react\";\n\nimport classnames from \"classnames\";\n\nimport {\n StyledTicketPerforation,\n StyledTicketPerforationEdge,\n StyledTicketPerforationLine,\n StyledTicketPerforationNotch,\n TicketPerforationLine,\n} from \"./Styles\";\n\nexport type { TicketPerforationLine };\n\nexport interface ITicketPerforationProps\n extends HTMLAttributes<HTMLDivElement> {\n /** The color of the dashed line: \"primary\" on a sheet, \"raised\" in a raised card. */\n line?: TicketPerforationLine;\n /** Without notches the tear is only its dashed line. */\n notches?: boolean;\n}\n\n/** The line where a ticket tears: a dashed line with a notch in each edge of a card with a 16px padding. */\nexport const TicketPerforation = forwardRef<\n HTMLDivElement,\n ITicketPerforationProps\n>(({ line = \"primary\", notches = true, className, ...rest }, ref) => (\n <StyledTicketPerforation\n aria-hidden=\"true\"\n {...rest}\n ref={ref}\n className={classnames(\"c-ticket-perforation\", className)}\n >\n {notches ? (\n <StyledTicketPerforationEdge $side=\"left\">\n <StyledTicketPerforationNotch $side=\"left\" />\n </StyledTicketPerforationEdge>\n ) : null}\n <StyledTicketPerforationLine $line={line} />\n {notches ? (\n <StyledTicketPerforationEdge $side=\"right\">\n <StyledTicketPerforationNotch $side=\"right\" />\n </StyledTicketPerforationEdge>\n ) : null}\n </StyledTicketPerforation>\n));\n\nTicketPerforation.displayName = \"TicketPerforation\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAoB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@@
|
|
|
1
1
|
import { ReactElement } from "react";
|
|
2
2
|
import { ShapeElementState, StickyTextStyle } from "./elements";
|
|
3
|
+
import { BoardLine, ConnectionAnchor, LineLabel, LineStyle, LineType } from "./lineModel";
|
|
3
4
|
import { ContextToolbarGroup } from "../whiteboardModern/contextToolbar";
|
|
4
5
|
export declare const lockDeleteGroup: (locked: boolean, onToggleLock: () => void, onDelete: () => void) => ContextToolbarGroup;
|
|
5
6
|
export declare const trashGroup: (onDelete: () => void) => ContextToolbarGroup;
|
|
@@ -19,4 +20,25 @@ export interface PostitFormattingToolbarProps {
|
|
|
19
20
|
onToggleLock: () => void;
|
|
20
21
|
}
|
|
21
22
|
export declare const PostitFormattingToolbar: ({ value, onChange, onDelete, locked, onToggleLock, }: PostitFormattingToolbarProps) => ReactElement;
|
|
23
|
+
export interface LineFormattingToolbarProps {
|
|
24
|
+
line: BoardLine;
|
|
25
|
+
onTypeChange: (type: LineType) => void;
|
|
26
|
+
onStyleChange: (partial: Partial<LineStyle>) => void;
|
|
27
|
+
onAnchorChange: (side: "start" | "end", anchor: ConnectionAnchor) => void;
|
|
28
|
+
onLabel: () => void;
|
|
29
|
+
onDelete: () => void;
|
|
30
|
+
locked: boolean;
|
|
31
|
+
onToggleLock: () => void;
|
|
32
|
+
left?: number;
|
|
33
|
+
top?: number;
|
|
34
|
+
}
|
|
35
|
+
export declare const LineFormattingToolbar: ({ line, onTypeChange, onStyleChange, onAnchorChange, onLabel, onDelete, locked, onToggleLock, left, top, }: LineFormattingToolbarProps) => ReactElement;
|
|
36
|
+
export interface LineLabelToolbarProps {
|
|
37
|
+
label: LineLabel;
|
|
38
|
+
onChange: (partial: Partial<LineLabel>) => void;
|
|
39
|
+
onRemove: () => void;
|
|
40
|
+
left?: number;
|
|
41
|
+
top?: number;
|
|
42
|
+
}
|
|
43
|
+
export declare const LineLabelToolbar: ({ label, onChange, onRemove, left, top, }: LineLabelToolbarProps) => ReactElement;
|
|
22
44
|
//# sourceMappingURL=elementToolbars.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elementToolbars.d.ts","sourceRoot":"","sources":["../../../../src/presentation/whiteboard/elementToolbars.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,
|
|
1
|
+
{"version":3,"file":"elementToolbars.d.ts","sourceRoot":"","sources":["../../../../src/presentation/whiteboard/elementToolbars.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAML,iBAAiB,EACjB,eAAe,EAEhB,MAAM,YAAY,CAAC;AACpB,OAAO,EAEL,SAAS,EACT,gBAAgB,EAOhB,SAAS,EAGT,SAAS,EAET,QAAQ,EAET,MAAM,aAAa,CAAC;AAQrB,OAAO,EAEL,mBAAmB,EAEpB,MAAM,oCAAoC,CAAC;AAU5C,eAAO,MAAM,eAAe,GAC1B,QAAQ,OAAO,EACf,cAAc,MAAM,IAAI,EACxB,UAAU,MAAM,IAAI,KACnB,mBAUF,CAAC;AAGF,eAAO,MAAM,UAAU,GAAI,UAAU,MAAM,IAAI,KAAG,mBAOjD,CAAC;AAyDF,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,iBAAiB,CAAC;IAC3B,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACxD,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B;AAKD,eAAO,MAAM,sBAAsB,GAAI,wDAMpC,2BAA2B,KAAG,YAmChC,CAAC;AAEF,MAAM,WAAW,4BAA4B;IAC3C,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;IAC1C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B;AAKD,eAAO,MAAM,uBAAuB,GAAI,sDAMrC,4BAA4B,KAAG,YAqBjC,CAAC;AAmCF,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,SAAS,CAAC;IAChB,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvC,aAAa,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;IACrD,cAAc,EAAE,CAAC,IAAI,EAAE,OAAO,GAAG,KAAK,EAAE,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC1E,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,qBAAqB,GAAI,4GAWnC,0BAA0B,KAAG,YA2G/B,CAAC;AAEF,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;IAChD,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,gBAAgB,GAAI,2CAM9B,qBAAqB,KAAG,YAmC1B,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { FONT_SIZE_OPTIONS, SHAPE_TYPE_ICON, SHAPE_TYPE_OPTIONS } from "./elements";
|
|
3
|
+
import { FONT_SIZE_OPTIONS, RADIUS_OPTIONS, SHAPE_TYPE_ICON, THICKNESS_OPTIONS, SHAPE_TYPE_OPTIONS } from "./elements";
|
|
4
|
+
import { ANCHOR_OPTIONS, CornerRadiusGlyph, LINE_END_OPTIONS, LINE_PATTERN_OPTIONS, LINE_TYPE_OPTIONS, LineEndGlyph, LinePatternGlyph, LineThicknessGlyph, LineTypeGlyph } from "./lineModel";
|
|
4
5
|
import { boardColorOptions } from "./palette";
|
|
5
|
-
import { LockIcon, TrashIcon } from "../../components/Icons";
|
|
6
|
+
import { ConnectionIcon, LockIcon, TextIcon, TrashIcon } from "../../components/Icons";
|
|
6
7
|
import { ContextToolbar } from "../whiteboardModern/contextToolbar";
|
|
7
8
|
|
|
8
9
|
/* ------------------------------------------------------------------ */
|
|
@@ -127,4 +128,152 @@ export const PostitFormattingToolbar = _ref2 => {
|
|
|
127
128
|
})], ...textGroups(value, update), lockDeleteGroup(locked, onToggleLock, onDelete)]
|
|
128
129
|
});
|
|
129
130
|
};
|
|
131
|
+
const endMenu = (label, side, value, onChange) => ({
|
|
132
|
+
kind: "menu",
|
|
133
|
+
label,
|
|
134
|
+
value,
|
|
135
|
+
options: LINE_END_OPTIONS.map(option => ({
|
|
136
|
+
id: option.id,
|
|
137
|
+
label: option.name,
|
|
138
|
+
icon: /*#__PURE__*/React.createElement(LineEndGlyph, {
|
|
139
|
+
type: option.id,
|
|
140
|
+
side: side
|
|
141
|
+
})
|
|
142
|
+
})),
|
|
143
|
+
onChange: id => onChange(id)
|
|
144
|
+
});
|
|
145
|
+
const anchorMenu = (label, value, onChange) => ({
|
|
146
|
+
kind: "menu",
|
|
147
|
+
label,
|
|
148
|
+
value,
|
|
149
|
+
options: ANCHOR_OPTIONS.map(option => ({
|
|
150
|
+
id: option.id,
|
|
151
|
+
label: option.name,
|
|
152
|
+
icon: /*#__PURE__*/React.createElement(ConnectionIcon, {
|
|
153
|
+
className: "i16"
|
|
154
|
+
})
|
|
155
|
+
})),
|
|
156
|
+
onChange: id => onChange(id)
|
|
157
|
+
});
|
|
158
|
+
export const LineFormattingToolbar = _ref3 => {
|
|
159
|
+
var _line$start_anchor, _line$end_anchor;
|
|
160
|
+
let line = _ref3.line,
|
|
161
|
+
onTypeChange = _ref3.onTypeChange,
|
|
162
|
+
onStyleChange = _ref3.onStyleChange,
|
|
163
|
+
onAnchorChange = _ref3.onAnchorChange,
|
|
164
|
+
onLabel = _ref3.onLabel,
|
|
165
|
+
onDelete = _ref3.onDelete,
|
|
166
|
+
locked = _ref3.locked,
|
|
167
|
+
onToggleLock = _ref3.onToggleLock,
|
|
168
|
+
left = _ref3.left,
|
|
169
|
+
top = _ref3.top;
|
|
170
|
+
const connector = line.kind === "connector";
|
|
171
|
+
const style = line.style;
|
|
172
|
+
return /*#__PURE__*/React.createElement(ContextToolbar, {
|
|
173
|
+
left: left,
|
|
174
|
+
top: top,
|
|
175
|
+
groups: [[{
|
|
176
|
+
kind: "menu",
|
|
177
|
+
label: "Line type",
|
|
178
|
+
value: line.type,
|
|
179
|
+
options: LINE_TYPE_OPTIONS.map(option => ({
|
|
180
|
+
id: option.id,
|
|
181
|
+
label: option.name,
|
|
182
|
+
icon: /*#__PURE__*/React.createElement(LineTypeGlyph, {
|
|
183
|
+
type: option.id
|
|
184
|
+
})
|
|
185
|
+
})),
|
|
186
|
+
onChange: id => onTypeChange(id)
|
|
187
|
+
}, {
|
|
188
|
+
kind: "menu",
|
|
189
|
+
label: "Style",
|
|
190
|
+
value: style.stroke_pattern,
|
|
191
|
+
options: LINE_PATTERN_OPTIONS.map(option => ({
|
|
192
|
+
id: option.id,
|
|
193
|
+
label: option.name,
|
|
194
|
+
icon: /*#__PURE__*/React.createElement(LinePatternGlyph, {
|
|
195
|
+
pattern: option.id
|
|
196
|
+
})
|
|
197
|
+
})),
|
|
198
|
+
onChange: id => onStyleChange({
|
|
199
|
+
stroke_pattern: id
|
|
200
|
+
})
|
|
201
|
+
}, {
|
|
202
|
+
kind: "menu",
|
|
203
|
+
label: "Thickness",
|
|
204
|
+
value: String(style.stroke_width),
|
|
205
|
+
options: THICKNESS_OPTIONS.map(width => ({
|
|
206
|
+
id: String(width),
|
|
207
|
+
label: width + " pt",
|
|
208
|
+
icon: /*#__PURE__*/React.createElement(LineThicknessGlyph, {
|
|
209
|
+
width: width
|
|
210
|
+
})
|
|
211
|
+
})),
|
|
212
|
+
onChange: id => onStyleChange({
|
|
213
|
+
stroke_width: Number(id)
|
|
214
|
+
})
|
|
215
|
+
}, colorItem("Stroke Color", "stroke", style.stroke, stroke => onStyleChange({
|
|
216
|
+
stroke
|
|
217
|
+
}), {})], [...(connector ? [anchorMenu("Start Point", (_line$start_anchor = line.start_anchor) != null ? _line$start_anchor : "center", anchor => onAnchorChange("start", anchor))] : []), endMenu("Start Arrow", "start", style.arrow_start, arrow_start => onStyleChange({
|
|
218
|
+
arrow_start
|
|
219
|
+
})), endMenu("End Arrow", "end", style.arrow_end, arrow_end => onStyleChange({
|
|
220
|
+
arrow_end
|
|
221
|
+
})), ...(connector ? [anchorMenu("End Point", (_line$end_anchor = line.end_anchor) != null ? _line$end_anchor : "center", anchor => onAnchorChange("end", anchor))] : [])], ...(line.type === "elbow" ? [[{
|
|
222
|
+
kind: "menu",
|
|
223
|
+
label: "Corner radius",
|
|
224
|
+
value: String(style.corner_radius),
|
|
225
|
+
options: RADIUS_OPTIONS.map(radius => ({
|
|
226
|
+
id: String(radius),
|
|
227
|
+
label: radius + " px",
|
|
228
|
+
icon: /*#__PURE__*/React.createElement(CornerRadiusGlyph, {
|
|
229
|
+
radius: radius
|
|
230
|
+
})
|
|
231
|
+
})),
|
|
232
|
+
onChange: id => onStyleChange({
|
|
233
|
+
corner_radius: Number(id)
|
|
234
|
+
})
|
|
235
|
+
}]] : []), [{
|
|
236
|
+
kind: "action",
|
|
237
|
+
label: line.label ? "Edit label" : "Add label",
|
|
238
|
+
icon: /*#__PURE__*/React.createElement(TextIcon, null),
|
|
239
|
+
tooltip: line.label ? "Edit label (Enter)" : "Add label (Enter)",
|
|
240
|
+
onClick: onLabel
|
|
241
|
+
}], lockDeleteGroup(locked, onToggleLock, onDelete)]
|
|
242
|
+
});
|
|
243
|
+
};
|
|
244
|
+
export const LineLabelToolbar = _ref4 => {
|
|
245
|
+
let label = _ref4.label,
|
|
246
|
+
onChange = _ref4.onChange,
|
|
247
|
+
onRemove = _ref4.onRemove,
|
|
248
|
+
left = _ref4.left,
|
|
249
|
+
top = _ref4.top;
|
|
250
|
+
return /*#__PURE__*/React.createElement(ContextToolbar, {
|
|
251
|
+
left: left,
|
|
252
|
+
top: top,
|
|
253
|
+
groups: [[{
|
|
254
|
+
kind: "fontSize",
|
|
255
|
+
value: label.font_size,
|
|
256
|
+
steps: FONT_SIZE_OPTIONS,
|
|
257
|
+
onChange: font_size => onChange({
|
|
258
|
+
font_size
|
|
259
|
+
})
|
|
260
|
+
}], [{
|
|
261
|
+
kind: "textStyles",
|
|
262
|
+
value: {
|
|
263
|
+
bold: label.bold,
|
|
264
|
+
italic: label.italic,
|
|
265
|
+
underline: label.underline,
|
|
266
|
+
strikethrough: label.strikethrough
|
|
267
|
+
},
|
|
268
|
+
onToggle: key => onChange({
|
|
269
|
+
[key]: !label[key]
|
|
270
|
+
})
|
|
271
|
+
}], [{
|
|
272
|
+
kind: "button",
|
|
273
|
+
label: "Remove label",
|
|
274
|
+
icon: /*#__PURE__*/React.createElement(TrashIcon, null),
|
|
275
|
+
onClick: onRemove
|
|
276
|
+
}]]
|
|
277
|
+
});
|
|
278
|
+
};
|
|
130
279
|
//# sourceMappingURL=elementToolbars.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elementToolbars.js","names":["React","FONT_SIZE_OPTIONS","SHAPE_TYPE_ICON","SHAPE_TYPE_OPTIONS","boardColorOptions","LockIcon","TrashIcon","ContextToolbar","ALIGN_ORDER","lockDeleteGroup","locked","onToggleLock","onDelete","kind","label","keys","icon","createElement","on","onClick","trashGroup","colorItem","role","value","onChange","options","paletteTitle","map","option","id","textGroups","fontSize","steps","bold","italic","underline","strikethrough","onToggle","key","align","ShapeFormattingToolbar","_ref","_element$align","element","onUpdate","groups","type","_SHAPE_TYPE_OPTIONS$f","find","fill","includeTransparent","_extends","PostitFormattingToolbar","_ref2","update","partial","color","includeDefault"],"sources":["../../../../src/presentation/whiteboard/elementToolbars.tsx"],"sourcesContent":["import React, { ReactElement } from \"react\";\n\nimport {\n FONT_SIZE_OPTIONS,\n SHAPE_TYPE_ICON,\n SHAPE_TYPE_OPTIONS,\n ShapeElementState,\n StickyTextStyle,\n TextAlign,\n} from \"./elements\";\nimport { ColorRole, boardColorOptions } from \"./palette\";\nimport { LockIcon, TrashIcon } from \"../../components/Icons\";\nimport {\n ContextToolbar,\n ContextToolbarGroup,\n ContextToolbarItem,\n} from \"../whiteboardModern/contextToolbar\";\n\n/* ------------------------------------------------------------------ */\n/* The board's element toolbars, drawn by the modern ContextToolbar */\n/* ------------------------------------------------------------------ */\n\nconst ALIGN_ORDER: TextAlign[] = [\"left\", \"center\", \"right\", \"justify\"];\n\n/* The trailing Lock · Delete group every toolbar of a lockable element\n carries. Mirrors app `toolbar/ToolbarActions.jsx`. */\nexport const lockDeleteGroup = (\n locked: boolean,\n onToggleLock: () => void,\n onDelete: () => void\n): ContextToolbarGroup => [\n {\n kind: \"button\",\n label: locked ? \"Unlock\" : \"Lock\",\n keys: [\"⇧\", \"⌘\", \"L\"],\n icon: <LockIcon />,\n on: locked,\n onClick: onToggleLock,\n },\n { kind: \"button\", label: \"Delete\", icon: <TrashIcon />, onClick: onDelete },\n];\n\n/* The single trailing action of a card (link, file): bin it. */\nexport const trashGroup = (onDelete: () => void): ContextToolbarGroup => [\n {\n kind: \"button\",\n label: \"Move to Trash\",\n icon: <TrashIcon />,\n onClick: onDelete,\n },\n];\n\nconst colorItem = (\n label: string,\n role: ColorRole,\n value: string,\n onChange: (value: string) => void,\n options: { includeTransparent?: boolean; includeDefault?: boolean }\n): ContextToolbarItem => ({\n kind: \"color\",\n label,\n paletteTitle: label,\n role,\n value,\n options: boardColorOptions(role, value, options).map((option) => option.id),\n onChange,\n});\n\ntype TextFields = Pick<\n StickyTextStyle,\n \"fontSize\" | \"bold\" | \"italic\" | \"underline\" | \"strikethrough\" | \"align\"\n>;\n\n/* The text controls the shape and sticky toolbars share: size · B / I / U / S\n and alignment. */\nconst textGroups = (\n value: TextFields,\n onChange: (partial: Partial<TextFields>) => void\n): ContextToolbarGroup[] => [\n [\n {\n kind: \"fontSize\",\n value: value.fontSize,\n steps: FONT_SIZE_OPTIONS,\n onChange: (fontSize) => onChange({ fontSize }),\n },\n ],\n [\n {\n kind: \"textStyles\",\n value: {\n bold: value.bold,\n italic: value.italic,\n underline: value.underline,\n strikethrough: value.strikethrough,\n },\n onToggle: (key) => onChange({ [key]: !value[key] }),\n },\n {\n kind: \"align\",\n value: value.align,\n options: ALIGN_ORDER,\n onChange: (align) => onChange({ align }),\n },\n ],\n];\n\nexport interface ShapeFormattingToolbarProps {\n element: ShapeElementState;\n onUpdate: (partial: Partial<ShapeElementState>) => void;\n onDelete: () => void;\n locked: boolean;\n onToggleLock: () => void;\n}\n\n/* Shape type and fill · the shared text controls · Lock / Delete. Stroke is\n edited only in the Inspector's Stroke group. Mirrors the app's\n ShapeFormattingToolbar. */\nexport const ShapeFormattingToolbar = ({\n element,\n onUpdate,\n onDelete,\n locked,\n onToggleLock,\n}: ShapeFormattingToolbarProps): ReactElement => (\n <ContextToolbar\n groups={[\n [\n {\n kind: \"menu\",\n label: \"Shape\",\n value: element.type,\n options: SHAPE_TYPE_OPTIONS.map((option) => ({\n id: option.type,\n label: option.label,\n icon: SHAPE_TYPE_ICON[option.type],\n })),\n onChange: (id) => {\n const type = SHAPE_TYPE_OPTIONS.find(\n (option) => option.type === id\n )?.type;\n\n if (type) {\n onUpdate({ type });\n }\n },\n },\n colorItem(\n \"Fill color\",\n \"fill\",\n element.fill,\n (fill) => onUpdate({ fill }),\n { includeTransparent: true }\n ),\n ],\n ...textGroups({ ...element, align: element.align ?? \"left\" }, onUpdate),\n lockDeleteGroup(locked, onToggleLock, onDelete),\n ]}\n />\n);\n\nexport interface PostitFormattingToolbarProps {\n value: StickyTextStyle;\n onChange: (next: StickyTextStyle) => void;\n onDelete: () => void;\n locked: boolean;\n onToggleLock: () => void;\n}\n\n/* Note colour · the shared text controls · Lock / Delete. The note's colour is\n its whole point, so its palette offers neither Default nor Transparent.\n Mirrors the app's PostitFormattingToolbar. */\nexport const PostitFormattingToolbar = ({\n value,\n onChange,\n onDelete,\n locked,\n onToggleLock,\n}: PostitFormattingToolbarProps): ReactElement => {\n const update = (partial: Partial<StickyTextStyle>): void =>\n onChange({ ...value, ...partial });\n\n return (\n <ContextToolbar\n groups={[\n [\n colorItem(\n \"Note color\",\n \"sticky\",\n value.color,\n (color) => update({ color }),\n { includeDefault: false }\n ),\n ],\n ...textGroups(value, update),\n lockDeleteGroup(locked, onToggleLock, onDelete),\n ]}\n />\n );\n};\n"],"mappings":";AAAA,OAAOA,KAAK,MAAwB,OAAO;AAE3C,SACEC,iBAAiB,EACjBC,eAAe,EACfC,kBAAkB,QAIb,YAAY;AACnB,SAAoBC,iBAAiB,QAAQ,WAAW;AACxD,SAASC,QAAQ,EAAEC,SAAS,QAAQ,wBAAwB;AAC5D,SACEC,cAAc,QAGT,oCAAoC;;AAE3C;AACA;AACA;;AAEA,MAAMC,WAAwB,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC;;AAEvE;AACA;AACA,OAAO,MAAMC,eAAe,GAAGA,CAC7BC,MAAe,EACfC,YAAwB,EACxBC,QAAoB,KACI,CACxB;EACEC,IAAI,EAAE,QAAQ;EACdC,KAAK,EAAEJ,MAAM,GAAG,QAAQ,GAAG,MAAM;EACjCK,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;EACrBC,IAAI,eAAEhB,KAAA,CAAAiB,aAAA,CAACZ,QAAQ,MAAE,CAAC;EAClBa,EAA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EN,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"elementToolbars.js","names":["React","FONT_SIZE_OPTIONS","RADIUS_OPTIONS","SHAPE_TYPE_ICON","THICKNESS_OPTIONS","SHAPE_TYPE_OPTIONS","ANCHOR_OPTIONS","CornerRadiusGlyph","LINE_END_OPTIONS","LINE_PATTERN_OPTIONS","LINE_TYPE_OPTIONS","LineEndGlyph","LinePatternGlyph","LineThicknessGlyph","LineTypeGlyph","boardColorOptions","ConnectionIcon","LockIcon","TextIcon","TrashIcon","ContextToolbar","ALIGN_ORDER","lockDeleteGroup","locked","onToggleLock","onDelete","kind","label","keys","icon","createElement","on","onClick","trashGroup","colorItem","role","value","onChange","options","paletteTitle","map","option","id","textGroups","fontSize","steps","bold","italic","underline","strikethrough","onToggle","key","align","ShapeFormattingToolbar","_ref","_element$align","element","onUpdate","groups","type","_SHAPE_TYPE_OPTIONS$f","find","fill","includeTransparent","_extends","PostitFormattingToolbar","_ref2","update","partial","color","includeDefault","endMenu","side","name","anchorMenu","className","LineFormattingToolbar","_ref3","_line$start_anchor","_line$end_anchor","line","onTypeChange","onStyleChange","onAnchorChange","onLabel","left","top","connector","style","stroke_pattern","pattern","String","stroke_width","width","Number","stroke","start_anchor","anchor","arrow_start","arrow_end","end_anchor","corner_radius","radius","tooltip","LineLabelToolbar","_ref4","onRemove","font_size"],"sources":["../../../../src/presentation/whiteboard/elementToolbars.tsx"],"sourcesContent":["import React, { ReactElement } from \"react\";\n\nimport {\n FONT_SIZE_OPTIONS,\n RADIUS_OPTIONS,\n SHAPE_TYPE_ICON,\n THICKNESS_OPTIONS,\n SHAPE_TYPE_OPTIONS,\n ShapeElementState,\n StickyTextStyle,\n TextAlign,\n} from \"./elements\";\nimport {\n ANCHOR_OPTIONS,\n BoardLine,\n ConnectionAnchor,\n CornerRadiusGlyph,\n LINE_END_OPTIONS,\n LINE_PATTERN_OPTIONS,\n LINE_TYPE_OPTIONS,\n LineEndGlyph,\n LineEndType,\n LineLabel,\n LinePattern,\n LinePatternGlyph,\n LineStyle,\n LineThicknessGlyph,\n LineType,\n LineTypeGlyph,\n} from \"./lineModel\";\nimport { ColorRole, boardColorOptions } from \"./palette\";\nimport {\n ConnectionIcon,\n LockIcon,\n TextIcon,\n TrashIcon,\n} from \"../../components/Icons\";\nimport {\n ContextToolbar,\n ContextToolbarGroup,\n ContextToolbarItem,\n} from \"../whiteboardModern/contextToolbar\";\n\n/* ------------------------------------------------------------------ */\n/* The board's element toolbars, drawn by the modern ContextToolbar */\n/* ------------------------------------------------------------------ */\n\nconst ALIGN_ORDER: TextAlign[] = [\"left\", \"center\", \"right\", \"justify\"];\n\n/* The trailing Lock · Delete group every toolbar of a lockable element\n carries. Mirrors app `toolbar/ToolbarActions.jsx`. */\nexport const lockDeleteGroup = (\n locked: boolean,\n onToggleLock: () => void,\n onDelete: () => void\n): ContextToolbarGroup => [\n {\n kind: \"button\",\n label: locked ? \"Unlock\" : \"Lock\",\n keys: [\"⇧\", \"⌘\", \"L\"],\n icon: <LockIcon />,\n on: locked,\n onClick: onToggleLock,\n },\n { kind: \"button\", label: \"Delete\", icon: <TrashIcon />, onClick: onDelete },\n];\n\n/* The single trailing action of a card (link, file): bin it. */\nexport const trashGroup = (onDelete: () => void): ContextToolbarGroup => [\n {\n kind: \"button\",\n label: \"Move to Trash\",\n icon: <TrashIcon />,\n onClick: onDelete,\n },\n];\n\nconst colorItem = (\n label: string,\n role: ColorRole,\n value: string,\n onChange: (value: string) => void,\n options: { includeTransparent?: boolean; includeDefault?: boolean }\n): ContextToolbarItem => ({\n kind: \"color\",\n label,\n paletteTitle: label,\n role,\n value,\n options: boardColorOptions(role, value, options).map((option) => option.id),\n onChange,\n});\n\ntype TextFields = Pick<\n StickyTextStyle,\n \"fontSize\" | \"bold\" | \"italic\" | \"underline\" | \"strikethrough\" | \"align\"\n>;\n\n/* The text controls the shape and sticky toolbars share: size · B / I / U / S\n and alignment. */\nconst textGroups = (\n value: TextFields,\n onChange: (partial: Partial<TextFields>) => void\n): ContextToolbarGroup[] => [\n [\n {\n kind: \"fontSize\",\n value: value.fontSize,\n steps: FONT_SIZE_OPTIONS,\n onChange: (fontSize) => onChange({ fontSize }),\n },\n ],\n [\n {\n kind: \"textStyles\",\n value: {\n bold: value.bold,\n italic: value.italic,\n underline: value.underline,\n strikethrough: value.strikethrough,\n },\n onToggle: (key) => onChange({ [key]: !value[key] }),\n },\n {\n kind: \"align\",\n value: value.align,\n options: ALIGN_ORDER,\n onChange: (align) => onChange({ align }),\n },\n ],\n];\n\nexport interface ShapeFormattingToolbarProps {\n element: ShapeElementState;\n onUpdate: (partial: Partial<ShapeElementState>) => void;\n onDelete: () => void;\n locked: boolean;\n onToggleLock: () => void;\n}\n\n/* Shape type and fill · the shared text controls · Lock / Delete. Stroke is\n edited only in the Inspector's Stroke group. Mirrors the app's\n ShapeFormattingToolbar. */\nexport const ShapeFormattingToolbar = ({\n element,\n onUpdate,\n onDelete,\n locked,\n onToggleLock,\n}: ShapeFormattingToolbarProps): ReactElement => (\n <ContextToolbar\n groups={[\n [\n {\n kind: \"menu\",\n label: \"Shape\",\n value: element.type,\n options: SHAPE_TYPE_OPTIONS.map((option) => ({\n id: option.type,\n label: option.label,\n icon: SHAPE_TYPE_ICON[option.type],\n })),\n onChange: (id) => {\n const type = SHAPE_TYPE_OPTIONS.find(\n (option) => option.type === id\n )?.type;\n\n if (type) {\n onUpdate({ type });\n }\n },\n },\n colorItem(\n \"Fill color\",\n \"fill\",\n element.fill,\n (fill) => onUpdate({ fill }),\n { includeTransparent: true }\n ),\n ],\n ...textGroups({ ...element, align: element.align ?? \"left\" }, onUpdate),\n lockDeleteGroup(locked, onToggleLock, onDelete),\n ]}\n />\n);\n\nexport interface PostitFormattingToolbarProps {\n value: StickyTextStyle;\n onChange: (next: StickyTextStyle) => void;\n onDelete: () => void;\n locked: boolean;\n onToggleLock: () => void;\n}\n\n/* Note colour · the shared text controls · Lock / Delete. The note's colour is\n its whole point, so its palette offers neither Default nor Transparent.\n Mirrors the app's PostitFormattingToolbar. */\nexport const PostitFormattingToolbar = ({\n value,\n onChange,\n onDelete,\n locked,\n onToggleLock,\n}: PostitFormattingToolbarProps): ReactElement => {\n const update = (partial: Partial<StickyTextStyle>): void =>\n onChange({ ...value, ...partial });\n\n return (\n <ContextToolbar\n groups={[\n [\n colorItem(\n \"Note color\",\n \"sticky\",\n value.color,\n (color) => update({ color }),\n { includeDefault: false }\n ),\n ],\n ...textGroups(value, update),\n lockDeleteGroup(locked, onToggleLock, onDelete),\n ]}\n />\n );\n};\n\nconst endMenu = (\n label: string,\n side: \"start\" | \"end\",\n value: LineEndType,\n onChange: (value: LineEndType) => void\n): ContextToolbarItem => ({\n kind: \"menu\",\n label,\n value,\n options: LINE_END_OPTIONS.map((option) => ({\n id: option.id,\n label: option.name,\n icon: <LineEndGlyph type={option.id} side={side} />,\n })),\n onChange: (id) => onChange(id as LineEndType),\n});\n\nconst anchorMenu = (\n label: string,\n value: ConnectionAnchor,\n onChange: (value: ConnectionAnchor) => void\n): ContextToolbarItem => ({\n kind: \"menu\",\n label,\n value,\n options: ANCHOR_OPTIONS.map((option) => ({\n id: option.id,\n label: option.name,\n icon: <ConnectionIcon className=\"i16\" />,\n })),\n onChange: (id) => onChange(id as ConnectionAnchor),\n});\n\nexport interface LineFormattingToolbarProps {\n line: BoardLine;\n onTypeChange: (type: LineType) => void;\n onStyleChange: (partial: Partial<LineStyle>) => void;\n onAnchorChange: (side: \"start\" | \"end\", anchor: ConnectionAnchor) => void;\n onLabel: () => void;\n onDelete: () => void;\n locked: boolean;\n onToggleLock: () => void;\n left?: number;\n top?: number;\n}\n\nexport const LineFormattingToolbar = ({\n line,\n onTypeChange,\n onStyleChange,\n onAnchorChange,\n onLabel,\n onDelete,\n locked,\n onToggleLock,\n left,\n top,\n}: LineFormattingToolbarProps): ReactElement => {\n const connector = line.kind === \"connector\";\n const { style } = line;\n\n return (\n <ContextToolbar\n left={left}\n top={top}\n groups={[\n [\n {\n kind: \"menu\",\n label: \"Line type\",\n value: line.type,\n options: LINE_TYPE_OPTIONS.map((option) => ({\n id: option.id,\n label: option.name,\n icon: <LineTypeGlyph type={option.id} />,\n })),\n onChange: (id) => onTypeChange(id as LineType),\n },\n {\n kind: \"menu\",\n label: \"Style\",\n value: style.stroke_pattern,\n options: LINE_PATTERN_OPTIONS.map((option) => ({\n id: option.id,\n label: option.name,\n icon: <LinePatternGlyph pattern={option.id} />,\n })),\n onChange: (id) =>\n onStyleChange({ stroke_pattern: id as LinePattern }),\n },\n {\n kind: \"menu\",\n label: \"Thickness\",\n value: String(style.stroke_width),\n options: THICKNESS_OPTIONS.map((width) => ({\n id: String(width),\n label: `${width} pt`,\n icon: <LineThicknessGlyph width={width} />,\n })),\n onChange: (id) => onStyleChange({ stroke_width: Number(id) }),\n },\n colorItem(\n \"Stroke Color\",\n \"stroke\",\n style.stroke,\n (stroke) => onStyleChange({ stroke }),\n {}\n ),\n ],\n [\n ...(connector\n ? [\n anchorMenu(\n \"Start Point\",\n line.start_anchor ?? \"center\",\n (anchor) => onAnchorChange(\"start\", anchor)\n ),\n ]\n : []),\n endMenu(\"Start Arrow\", \"start\", style.arrow_start, (arrow_start) =>\n onStyleChange({ arrow_start })\n ),\n endMenu(\"End Arrow\", \"end\", style.arrow_end, (arrow_end) =>\n onStyleChange({ arrow_end })\n ),\n ...(connector\n ? [\n anchorMenu(\"End Point\", line.end_anchor ?? \"center\", (anchor) =>\n onAnchorChange(\"end\", anchor)\n ),\n ]\n : []),\n ],\n ...(line.type === \"elbow\"\n ? [\n [\n {\n kind: \"menu\",\n label: \"Corner radius\",\n value: String(style.corner_radius),\n options: RADIUS_OPTIONS.map((radius) => ({\n id: String(radius),\n label: `${radius} px`,\n icon: <CornerRadiusGlyph radius={radius} />,\n })),\n onChange: (id) =>\n onStyleChange({ corner_radius: Number(id) }),\n } as ContextToolbarItem,\n ],\n ]\n : []),\n [\n {\n kind: \"action\",\n label: line.label ? \"Edit label\" : \"Add label\",\n icon: <TextIcon />,\n tooltip: line.label ? \"Edit label (Enter)\" : \"Add label (Enter)\",\n onClick: onLabel,\n },\n ],\n lockDeleteGroup(locked, onToggleLock, onDelete),\n ]}\n />\n );\n};\n\nexport interface LineLabelToolbarProps {\n label: LineLabel;\n onChange: (partial: Partial<LineLabel>) => void;\n onRemove: () => void;\n left?: number;\n top?: number;\n}\n\nexport const LineLabelToolbar = ({\n label,\n onChange,\n onRemove,\n left,\n top,\n}: LineLabelToolbarProps): ReactElement => (\n <ContextToolbar\n left={left}\n top={top}\n groups={[\n [\n {\n kind: \"fontSize\",\n value: label.font_size,\n steps: FONT_SIZE_OPTIONS,\n onChange: (font_size) => onChange({ font_size }),\n },\n ],\n [\n {\n kind: \"textStyles\",\n value: {\n bold: label.bold,\n italic: label.italic,\n underline: label.underline,\n strikethrough: label.strikethrough,\n },\n onToggle: (key) => onChange({ [key]: !label[key] }),\n },\n ],\n [\n {\n kind: \"button\",\n label: \"Remove label\",\n icon: <TrashIcon />,\n onClick: onRemove,\n },\n ],\n ]}\n />\n);\n"],"mappings":";AAAA,OAAOA,KAAK,MAAwB,OAAO;AAE3C,SACEC,iBAAiB,EACjBC,cAAc,EACdC,eAAe,EACfC,iBAAiB,EACjBC,kBAAkB,QAIb,YAAY;AACnB,SACEC,cAAc,EAGdC,iBAAiB,EACjBC,gBAAgB,EAChBC,oBAAoB,EACpBC,iBAAiB,EACjBC,YAAY,EAIZC,gBAAgB,EAEhBC,kBAAkB,EAElBC,aAAa,QACR,aAAa;AACpB,SAAoBC,iBAAiB,QAAQ,WAAW;AACxD,SACEC,cAAc,EACdC,QAAQ,EACRC,QAAQ,EACRC,SAAS,QACJ,wBAAwB;AAC/B,SACEC,cAAc,QAGT,oCAAoC;;AAE3C;AACA;AACA;;AAEA,MAAMC,WAAwB,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC;;AAEvE;AACA;AACA,OAAO,MAAMC,eAAe,GAAGA,CAC7BC,MAA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;EACD,CACH,CAAC;AAAA,CACH","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ReactElement } from "react";
|
|
1
|
+
import React, { ReactElement, ReactNode } from "react";
|
|
2
2
|
import { CanvasElementDef, ShapeElementState, ShapeType, StickyTextStyle } from "./elements";
|
|
3
3
|
import { FileElementDef } from "./fileElement";
|
|
4
4
|
import { LinkElementDef } from "./linkElement";
|
|
@@ -91,8 +91,16 @@ export interface ColorPickerFieldProps {
|
|
|
91
91
|
onSelect: (color: string) => void;
|
|
92
92
|
}
|
|
93
93
|
export declare const ColorPickerField: ({ value, role, disabled, includeTransparent, includeDefault, onSelect, }: ColorPickerFieldProps) => ReactElement;
|
|
94
|
+
export interface InspectorCustomElement {
|
|
95
|
+
id: string;
|
|
96
|
+
icon: ReactNode;
|
|
97
|
+
name: string;
|
|
98
|
+
onRename?: (name: string) => void;
|
|
99
|
+
groups: ReactNode;
|
|
100
|
+
}
|
|
94
101
|
export interface RightInspectorProps {
|
|
95
102
|
selectedId: string | null;
|
|
103
|
+
custom?: InspectorCustomElement | null;
|
|
96
104
|
positions: Record<string, {
|
|
97
105
|
x: number;
|
|
98
106
|
y: number;
|
|
@@ -125,5 +133,5 @@ export interface RightInspectorProps {
|
|
|
125
133
|
locks: Record<string, boolean>;
|
|
126
134
|
setLocks: React.Dispatch<React.SetStateAction<Record<string, boolean>>>;
|
|
127
135
|
}
|
|
128
|
-
export declare const RightInspector: ({ selectedId, positions, setPositions, sizes, setSizes, rotations, setRotations, shapes, setShapes, stickyStyle, setStickyStyle, links, setLinks, files, setFiles, createdShapes, projectElements, setProjectElements, locks, setLocks, }: RightInspectorProps) => ReactElement;
|
|
136
|
+
export declare const RightInspector: ({ selectedId, custom, positions, setPositions, sizes, setSizes, rotations, setRotations, shapes, setShapes, stickyStyle, setStickyStyle, links, setLinks, files, setFiles, createdShapes, projectElements, setProjectElements, locks, setLocks, }: RightInspectorProps) => ReactElement;
|
|
129
137
|
//# sourceMappingURL=inspector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspector.d.ts","sourceRoot":"","sources":["../../../../src/presentation/whiteboard/inspector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"inspector.d.ts","sourceRoot":"","sources":["../../../../src/presentation/whiteboard/inspector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,SAAS,EAAyB,MAAM,OAAO,CAAC;AAI9E,OAAO,EAGL,gBAAgB,EAMhB,iBAAiB,EACjB,SAAS,EACT,eAAe,EAMhB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAkB,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAQ/C,OAAO,EAEL,SAAS,EAGV,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,iBAAiB,EAGlB,MAAM,mBAAmB,CAAC;AA2B3B,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,UAAU,GAAG,IAAI,CAAC;AASzD,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IAMd,SAAS,CAAC,EAAE,OAAO,CAAC;IAKpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IAIrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,GAAI,KAAK,gBAAgB,KAAG,aAgB/C,CAAC;AAER;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB,EAAE,aAOpC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,EAAE,aAGpC,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AC,CAAC,CAAC;IAC9E,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;CACzE;AAED,eAAO,MAAM,cAAc,GAAI,mPAsB5B,mBAAmB,KAAG,YA+xBxB,CAAC"}
|
|
@@ -271,6 +271,7 @@ export const ColorPickerField = _ref5 => {
|
|
|
271
271
|
export const RightInspector = _ref6 => {
|
|
272
272
|
var _sizes$def$id, _positions$def$id, _rotations$def$id, _names$def$id, _shape$align, _BORDER_STYLE_OPTIONS, _BORDER_STYLE_OPTIONS2;
|
|
273
273
|
let selectedId = _ref6.selectedId,
|
|
274
|
+
custom = _ref6.custom,
|
|
274
275
|
positions = _ref6.positions,
|
|
275
276
|
setPositions = _ref6.setPositions,
|
|
276
277
|
sizes = _ref6.sizes,
|
|
@@ -475,7 +476,7 @@ export const RightInspector = _ref6 => {
|
|
|
475
476
|
/* Header + panel switch + body, shared by every element kind — only the
|
|
476
477
|
groups inside differ. `renamable` false swaps the live EditableText for
|
|
477
478
|
read-only text, for elements whose name is not the board's to change. */
|
|
478
|
-
const renderInspectorBody = function (icon, headerName, id, groups, renamable) {
|
|
479
|
+
const renderInspectorBody = function (icon, headerName, id, groups, renamable, onRename) {
|
|
479
480
|
if (renamable === void 0) {
|
|
480
481
|
renamable = true;
|
|
481
482
|
}
|
|
@@ -487,7 +488,7 @@ export const RightInspector = _ref6 => {
|
|
|
487
488
|
value: headerName,
|
|
488
489
|
variant: "Header 3",
|
|
489
490
|
weight: "bold",
|
|
490
|
-
onSave: event => setNames(current => _extends({}, current, {
|
|
491
|
+
onSave: event => onRename ? onRename(event.target.value) : setNames(current => _extends({}, current, {
|
|
491
492
|
[id]: event.target.value
|
|
492
493
|
})),
|
|
493
494
|
inputProps: {
|
|
@@ -509,6 +510,9 @@ export const RightInspector = _ref6 => {
|
|
|
509
510
|
onChange: selected => setTab(selected[0])
|
|
510
511
|
}))), tab === "comments" ? /*#__PURE__*/React.createElement(StyledInspectorEmpty, null, /*#__PURE__*/React.createElement(Body2, null, "The comments stream is coming soon.")) : /*#__PURE__*/React.createElement(StyledPropGroups, null, groups));
|
|
511
512
|
};
|
|
513
|
+
if (custom && custom.id === selectedId) {
|
|
514
|
+
return shell(renderInspectorBody(custom.icon, custom.name, custom.id, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledPropGroup, null, renderLocked(custom.id)), custom.groups), true, custom.onRename));
|
|
515
|
+
}
|
|
512
516
|
|
|
513
517
|
/* Nothing selected. */
|
|
514
518
|
if (!def && !linkDef && !fileDef && !projectDef) {
|