@_linked/shape-ui 2.3.1 → 2.3.2

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 (32) hide show
  1. package/lib/esm/components/AvatarEditor.d.ts +19 -0
  2. package/lib/esm/components/AvatarEditor.js +6 -0
  3. package/lib/esm/components/AvatarEditor.js.map +1 -0
  4. package/lib/esm/components/CheckboxEditor.d.ts +20 -0
  5. package/lib/esm/components/CheckboxEditor.js +41 -0
  6. package/lib/esm/components/CheckboxEditor.js.map +1 -0
  7. package/lib/esm/components/DateEditor.d.ts +19 -0
  8. package/lib/esm/components/DateEditor.js +22 -0
  9. package/lib/esm/components/DateEditor.js.map +1 -0
  10. package/lib/esm/components/RadioButtonEditor.d.ts +22 -0
  11. package/lib/esm/components/RadioButtonEditor.js +39 -0
  12. package/lib/esm/components/RadioButtonEditor.js.map +1 -0
  13. package/lib/esm/components/SelectEditor.d.ts +20 -0
  14. package/lib/esm/components/SelectEditor.js +30 -0
  15. package/lib/esm/components/SelectEditor.js.map +1 -0
  16. package/lib/esm/components/SwitchEditor.d.ts +20 -0
  17. package/lib/esm/components/SwitchEditor.js +23 -0
  18. package/lib/esm/components/SwitchEditor.js.map +1 -0
  19. package/lib/esm/components/TextareaEditor.d.ts +22 -0
  20. package/lib/esm/components/TextareaEditor.js +15 -0
  21. package/lib/esm/components/TextareaEditor.js.map +1 -0
  22. package/lib/esm/components/ToggleEditor.d.ts +21 -0
  23. package/lib/esm/components/ToggleEditor.js +23 -0
  24. package/lib/esm/components/ToggleEditor.js.map +1 -0
  25. package/lib/esm/index.d.ts +10 -0
  26. package/lib/esm/index.js +24 -0
  27. package/lib/esm/index.js.map +1 -1
  28. package/lib/esm/shape/types.d.ts +697 -0
  29. package/lib/esm/shape/types.js +212 -0
  30. package/lib/esm/shape/types.js.map +1 -0
  31. package/package.json +1 -1
  32. package/src/index.ts +25 -0
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import type { PropertyShapeWire } from '@_linked/core/shapes/nodeShapeWire';
3
+ export interface AvatarEditorProps {
4
+ of?: Record<string, any>;
5
+ property?: PropertyShapeWire;
6
+ /**
7
+ * Converts the value returned by the shape, to the input string for the avatar
8
+ * @param shapePropertyValue
9
+ * @returns
10
+ */
11
+ preConvertValueFn?: (shapePropertyValue: any) => string;
12
+ /**
13
+ * Converts the value of the avatar to a value that can be provided to the set method of the shape
14
+ * @param inputValue
15
+ * @returns
16
+ */
17
+ postConvertValueFn?: (inputValue: string) => any;
18
+ }
19
+ export declare const AvatarEditor: ({ of, property, preConvertValueFn, postConvertValueFn, ...restProps }: AvatarEditorProps) => React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Root, Image } from '@_linked/primitives/components/Avatar';
3
+ export const AvatarEditor = ({ of, property, preConvertValueFn, postConvertValueFn, ...restProps }) => {
4
+ return (_jsx(Root, { children: _jsx(Image, {}) }));
5
+ };
6
+ //# sourceMappingURL=AvatarEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AvatarEditor.js","sourceRoot":"","sources":["../../../src/components/AvatarEditor.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,uCAAuC,CAAC;AAmBpE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,EAAE,EACF,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAClB,GAAG,SAAS,EACM,EAAE,EAAE;IACtB,OAAO,CACL,KAAC,IAAI,cACH,KAAC,KAAK,KAAG,GACJ,CACR,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import type { PropertyShapeWire } from '@_linked/core/shapes/nodeShapeWire';
3
+ export interface CheckboxEditorProps {
4
+ onCheckedChange?: (e: any) => void;
5
+ of?: Record<string, any>;
6
+ property?: PropertyShapeWire;
7
+ /**
8
+ * Converts the value returned by the shape, to the input string for the checkbox
9
+ * @param shapePropertyValue
10
+ * @returns
11
+ */
12
+ preConvertValueFn?: (shapePropertyValue: any) => string;
13
+ /**
14
+ * Converts the value of the checkbox to a value that can be provided to the set method of the shape
15
+ * @param inputValue
16
+ * @returns
17
+ */
18
+ postConvertValueFn?: (inputValue: string) => any;
19
+ }
20
+ export declare const CheckboxEditor: ({ onCheckedChange, of, property, preConvertValueFn, postConvertValueFn, ...restProps }: CheckboxEditorProps) => React.JSX.Element;
@@ -0,0 +1,41 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Checkbox } from '@_linked/primitives/components/Checkbox';
3
+ import style from './CheckboxEditor.module.css';
4
+ export const CheckboxEditor = ({ onCheckedChange, of, property, preConvertValueFn, postConvertValueFn, ...restProps }) => {
5
+ const currentValues = of[property.label];
6
+ const onChangeHandler = (item, checked) => {
7
+ if (!of)
8
+ return;
9
+ if (property.in) {
10
+ if (checked) {
11
+ currentValues.add(item);
12
+ }
13
+ else {
14
+ currentValues.delete(item);
15
+ }
16
+ }
17
+ else {
18
+ of[property.label] = checked;
19
+ }
20
+ if (onCheckedChange) {
21
+ onCheckedChange(currentValues);
22
+ }
23
+ };
24
+ return (_jsx(_Fragment, { children: property.in ? (property.in.map((item, i) => {
25
+ return (_jsxs("label", { className: style.Root, children: [_jsx(Checkbox, { value: of[property.label], onCheckedChange: onChangeHandler.bind(this, item), defaultChecked: currentValues.has(item), ...restProps }), "TODO: ", item.toString()] }));
26
+ })) : (_jsx("div", { children: "checkbox usage unimplemented" })
27
+ // <Checkbox
28
+ // value={of[property.label]}
29
+ // onCheckedChange={onChangeHandler}
30
+ // defaultChecked={
31
+ // of
32
+ // ? preConvertValueFn
33
+ // ? preConvertValueFn(of[property.label])
34
+ // : of[property.label]
35
+ // : ''
36
+ // }
37
+ // {...restProps}
38
+ // />
39
+ ) }));
40
+ };
41
+ //# sourceMappingURL=CheckboxEditor.js.map
@@ -0,0 +1 @@
1
+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E,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,KACnC,SAAS,GACb,YACK,IAAI,CAAC,QAAQ,EAAE,IAChB,CACT,CAAC;QACJ,CAAC,CAAC,CACH,CAAC,CAAC,CAAC,CACF,yDAAuC;QACvC,YAAY;QACZ,+BAA+B;QAC/B,sCAAsC;QACtC,qBAAqB;QACrB,SAAS;QACT,4BAA4B;QAC5B,kDAAkD;QAClD,+BAA+B;QAC/B,aAAa;QACb,MAAM;QACN,mBAAmB;QACnB,KAAK;SACN,GACA,CACJ,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ export interface DateEditorProps {
3
+ onChange?: (e: any) => void;
4
+ of?: Record<string, any>;
5
+ property?: string;
6
+ /**
7
+ * Converts the value returned by the shape, to the date string for the date field
8
+ * @param shapePropertyValue
9
+ * @returns
10
+ */
11
+ preConvertValueFn?: (shapePropertyValue: any) => string;
12
+ /**
13
+ * Converts the value of the date field to a value that can be provided to the set method of the shape
14
+ * @param inputValue
15
+ * @returns
16
+ */
17
+ postConvertValueFn?: (inputValue: string) => any;
18
+ }
19
+ export declare const DateEditor: ({ onChange, of, property, preConvertValueFn, postConvertValueFn, ...restProps }: DateEditorProps) => React.JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ export const DateEditor = ({ onChange, of, property, preConvertValueFn, postConvertValueFn, ...restProps }) => {
3
+ const onChangeHandler = (e) => {
4
+ if (onChange) {
5
+ onChange(e);
6
+ }
7
+ };
8
+ return (_jsx(_Fragment, {})
9
+ // <Input
10
+ // onChange={onChangeHandler}
11
+ // defaultValue={
12
+ // of
13
+ // ? preConvertValueFn
14
+ // ? preConvertValueFn(of[property])
15
+ // : of[property]
16
+ // : ''
17
+ // }
18
+ // {...restProps}
19
+ // />
20
+ );
21
+ };
22
+ //# sourceMappingURL=DateEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateEditor.js","sourceRoot":"","sources":["../../../src/components/DateEditor.tsx"],"names":[],"mappings":";AAoBA,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACzB,QAAQ,EACR,EAAE,EACF,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAElB,GAAG,SAAS,EACI,EAAE,EAAE;IACpB,MAAM,eAAe,GAAG,CAAC,CAAC,EAAE,EAAE;QAC5B,IAAI,QAAQ,EAAE,CAAC;YACb,QAAQ,CAAC,CAAC,CAAC,CAAC;QACd,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,mBAAK;IACL,SAAS;IACT,+BAA+B;IAC/B,mBAAmB;IACnB,SAAS;IACT,4BAA4B;IAC5B,4CAA4C;IAC5C,yBAAyB;IACzB,aAAa;IACb,MAAM;IACN,mBAAmB;IACnB,KAAK;KACN,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import type { PropertyShapeWire } from '@_linked/core/shapes/nodeShapeWire';
3
+ export interface RadioButtonProps {
4
+ onValueChange?: (newValue: any) => void;
5
+ of?: Record<string, any>;
6
+ property?: PropertyShapeWire;
7
+ children?: React.ReactNode;
8
+ className?: string;
9
+ /**
10
+ * Converts the value returned by the shape, to the radio input string for the radio input
11
+ * @param shapePropertyValue
12
+ * @returns
13
+ */
14
+ preConvertValueFn?: (shapePropertyValue: any) => string;
15
+ /**
16
+ * Converts the value of the radio input to a value that can be provided to the set method of the shape
17
+ * @param radioInputValue
18
+ * @returns
19
+ */
20
+ postConvertValueFn?: (radioInputValue: string) => any;
21
+ }
22
+ export declare const RadioButtonEditor: React.FC<RadioButtonProps>;
@@ -0,0 +1,39 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
3
+ import { RadioGroup } from '@_linked/primitives/components/RadioGroup';
4
+ import styles from './RadioButtonEditor.module.css';
5
+ import { cl } from '@_linked/react/utils/ClassNames';
6
+ export const RadioButtonEditor = ({ onValueChange, of, property, preConvertValueFn, postConvertValueFn, children, className, ...props }) => {
7
+ const [labelHasLongString, setLabelHasLongString] = useState(false);
8
+ const onChangeHandler = (newValue) => {
9
+ if (!of)
10
+ return;
11
+ of[property.label] = newValue;
12
+ if (onValueChange) {
13
+ onValueChange(of[property.label]);
14
+ // onValueChange(
15
+ // options.map((option) => {
16
+ // console.log(option, 'option');
17
+ // of[property.label] = newValue;
18
+ // }),
19
+ // );
20
+ }
21
+ };
22
+ useEffect(() => {
23
+ //check if radio button label has a long string
24
+ if (property.in) {
25
+ const containsLongString = property.in.some((list) => {
26
+ throw Error('TODO: property.in for RadioButtonEditor');
27
+ // const wordCount = list.value.split(' ').length;
28
+ // return wordCount > 5;
29
+ });
30
+ setLabelHasLongString(containsLongString);
31
+ }
32
+ }, [property.in]);
33
+ // function cl(radioButtonField: any, arg1: any): string {
34
+ // throw new Error('Function not implemented.');
35
+ // }
36
+ console.log('of.label', of[property.label]);
37
+ return (_jsx(_Fragment, { children: _jsx(RadioGroup.Root, { defaultValue: "default", "aria-label": "View density", className: cl(styles.Root, labelHasLongString && styles.columnBased), children: property.in ? (property.in.map((item) => (_jsxs("label", { className: styles.radioButtonItem, children: [_jsx(RadioGroup.Item, { value: item.toString(), className: styles.radioButton }), "TODO: item from property.in"] })))) : (_jsx("p", { children: "unimplemented single radio button" })) }) }));
38
+ };
39
+ //# sourceMappingURL=RadioButtonEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RadioButtonEditor.js","sourceRoot":"","sources":["../../../src/components/RadioButtonEditor.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAc,UAAU,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,MAAM,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AAsBrD,MAAM,CAAC,MAA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CAAC,IAAI,EAAE,kBAAkB,IAAI,MAAM,CAAC,WAAW,CAAC,YAEnE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CACb,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACxB,iBAAO,SAAS,EAAE,MAAM,CAAC,eAAe,aACtC,KAAC,UAAU,CAAC,IAAI,IACd,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,EACtB,SAAS,EAAE,MAAM,CAAC,WAAW,GAC7B,mCAGI,CACT,CAAC,CACH,CAAC,CAAC,CAAC,CACF,4DAAwC,CACzC,GACe,GACjB,CACJ,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import type { PropertyShapeWire } from '@_linked/core/shapes/nodeShapeWire';
3
+ export interface SelectEditorProps {
4
+ onValueChange?: (e: any) => void;
5
+ of?: Record<string, any>;
6
+ property?: PropertyShapeWire;
7
+ /**
8
+ * Converts the value returned by the shape, to the input string for the select
9
+ * @param shapePropertyValue
10
+ * @returns
11
+ */
12
+ preConvertValueFn?: (shapePropertyValue: any) => string;
13
+ /**
14
+ * Converts the value of the select to a value that can be provided to the set method of the shape
15
+ * @param inputValue
16
+ * @returns
17
+ */
18
+ postConvertValueFn?: (inputValue: string) => any;
19
+ }
20
+ export declare const SelectEditor: ({ onValueChange, of, property, preConvertValueFn, postConvertValueFn, ...restProps }: SelectEditorProps) => React.JSX.Element;
@@ -0,0 +1,30 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Root, } from '@_linked/primitives/components/Select';
3
+ // interface RootSelectProps extend {
4
+ // of?: Record<string, any>;
5
+ // property?: PropertyShapeWire;
6
+ // }
7
+ // const RootSelect = () => {
8
+ // return <Root></Root>;
9
+ // };
10
+ export const SelectEditor = ({ onValueChange, of, property, preConvertValueFn, postConvertValueFn, ...restProps }) => {
11
+ const onChangeHandler = (value) => {
12
+ console.log(value, 'value select');
13
+ if (!of)
14
+ return;
15
+ if (postConvertValueFn) {
16
+ value = postConvertValueFn(value);
17
+ }
18
+ of[property.label] = value;
19
+ console.log(of[property.label], 'of[property.label] switch');
20
+ if (onValueChange) {
21
+ onValueChange(value);
22
+ }
23
+ };
24
+ return (_jsx(Root, { value: of[property.label], onValueChange: onChangeHandler, defaultValue: of
25
+ ? preConvertValueFn
26
+ ? preConvertValueFn(of[property.label])
27
+ : of[property.label]
28
+ : '', ...restProps }));
29
+ };
30
+ //# sourceMappingURL=SelectEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectEditor.js","sourceRoot":"","sources":["../../../src/components/SelectEditor.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,IAAI,GAUL,MAAM,uCAAuC,CAAC;AAoB/C,sCAAsC;AACtC,8BAA8B;AAC9B,kCAAkC;AAClC,IAAI;AACJ,6BAA6B;AAC7B,0BAA0B;AAC1B,KAAK;AAEL,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,aAAa,EACb,EAAE,EACF,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAClB,GAAG,SAAS,EACM,EAAE,EAAE;IACtB,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,EAAE;QAChC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;QACnC,IAAI,CAAC,EAAE;YAAE,OAAO;QAChB,IAAI,kBAAkB,EAAE,CAAC;YACvB,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC;QACD,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,2BAA2B,CAAC,CAAC;QAE7D,IAAI,aAAa,EAAE,CAAC;YAClB,aAAa,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,IAAI,IACH,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EACzB,aAAa,EAAE,eAAe,EAC9B,YAAY,EACV,EAAE;YACA,CAAC,CAAC,iBAAiB;gBACjB,CAAC,CAAC,iBAAiB,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;gBACvC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC;YACtB,CAAC,CAAC,EAAE,KAEJ,SAAS,GAQR,CACR,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import type { PropertyShapeWire } from '@_linked/core/shapes/nodeShapeWire';
3
+ export interface SwitchEditorProps {
4
+ onCheckedChange?: (e: any) => void;
5
+ of?: Record<string, any>;
6
+ property?: PropertyShapeWire;
7
+ /**
8
+ * Converts the value returned by the shape, to the input string for the switch
9
+ * @param shapePropertyValue
10
+ * @returns
11
+ */
12
+ preConvertValueFn?: (shapePropertyValue: any) => string;
13
+ /**
14
+ * Converts the value of the switch to a value that can be provided to the set method of the shape
15
+ * @param inputValue
16
+ * @returns
17
+ */
18
+ postConvertValueFn?: (inputValue: string) => any;
19
+ }
20
+ export declare const SwitchEditor: ({ onCheckedChange, of, property, preConvertValueFn, postConvertValueFn, ...restProps }: SwitchEditorProps) => React.JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Switch } from '@_linked/primitives/components/Switch';
3
+ export const SwitchEditor = ({ onCheckedChange, of, property, preConvertValueFn, postConvertValueFn, ...restProps }) => {
4
+ const onChangeHandler = (value) => {
5
+ console.log(value, 'value switch');
6
+ if (!of)
7
+ return;
8
+ if (postConvertValueFn) {
9
+ value = postConvertValueFn(value);
10
+ }
11
+ of[property.label] = value;
12
+ console.log(of[property.label], 'of[property.label] switch');
13
+ if (onCheckedChange) {
14
+ onCheckedChange(value);
15
+ }
16
+ };
17
+ return (_jsx(Switch, { value: of[property.label], onCheckedChange: onChangeHandler, defaultChecked: of
18
+ ? preConvertValueFn
19
+ ? preConvertValueFn(of[property.label])
20
+ : of[property.label]
21
+ : '', ...restProps }));
22
+ };
23
+ //# sourceMappingURL=SwitchEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SwitchEditor.js","sourceRoot":"","sources":["../../../src/components/SwitchEditor.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAqB/D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,eAAe,EACf,EAAE,EACF,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAClB,GAAG,SAAS,EACM,EAAE,EAAE;IACtB,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,EAAE;QAChC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;QACnC,IAAI,CAAC,EAAE;YAAE,OAAO;QAChB,IAAI,kBAAkB,EAAE,CAAC;YACvB,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC;QACD,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,2BAA2B,CAAC,CAAC;QAE7D,IAAI,eAAe,EAAE,CAAC;YACpB,eAAe,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,MAAM,IACL,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EACzB,eAAe,EAAE,eAAe,EAChC,cAAc,EACZ,EAAE;YACA,CAAC,CAAC,iBAAiB;gBACjB,CAAC,CAAC,iBAAiB,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;gBACvC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC;YACtB,CAAC,CAAC,EAAE,KAEJ,SAAS,GACb,CACH,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ export interface TextareaEditorProps {
3
+ onChange?: (e: any) => void;
4
+ value?: string[];
5
+ of?: Record<string, any>;
6
+ property?: string;
7
+ children?: any;
8
+ className?: any;
9
+ /**
10
+ * Converts the value returned by the shape, to the text area string for the text area
11
+ * @param shapePropertyValue
12
+ * @returns
13
+ */
14
+ preConvertValueFn?: (shapePropertyValue: any) => string;
15
+ /**
16
+ * Converts the value of the text area to a value that can be provided to the set method of the shape
17
+ * @param textAreaValue
18
+ * @returns
19
+ */
20
+ postConvertValueFn?: (textAreaValue: string) => any;
21
+ }
22
+ export declare const TextareaEditor: ({ onChange, value, of, property, preConvertValueFn, postConvertValueFn, children, className, ...props }: TextareaEditorProps) => React.JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Textarea } from '@_linked/primitives/components/Textarea';
3
+ export const TextareaEditor = ({ onChange, value, of, property, preConvertValueFn, postConvertValueFn, children, className, ...props }) => {
4
+ const onChangeHandler = (e) => {
5
+ if (onChange) {
6
+ onChange(e);
7
+ }
8
+ };
9
+ return (_jsx(Textarea, { onChange: onChangeHandler, defaultValue: of
10
+ ? preConvertValueFn
11
+ ? preConvertValueFn(of[property])
12
+ : of[property]
13
+ : '', value: value, ...props }));
14
+ };
15
+ //# sourceMappingURL=TextareaEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextareaEditor.js","sourceRoot":"","sources":["../../../src/components/TextareaEditor.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AAsBnE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC7B,QAAQ,EACR,KAAK,EACL,EAAE,EACF,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAClB,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACY,EAAE,EAAE;IACxB,MAAM,eAAe,GAAG,CAAC,CAAC,EAAE,EAAE;QAC5B,IAAI,QAAQ,EAAE,CAAC;YACb,QAAQ,CAAC,CAAC,CAAC,CAAC;QACd,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,QAAQ,IACP,QAAQ,EAAE,eAAe,EACzB,YAAY,EACV,EAAE;YACA,CAAC,CAAC,iBAAiB;gBACjB,CAAC,CAAC,iBAAiB,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;gBACjC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC;YAChB,CAAC,CAAC,EAAE,EAER,KAAK,EAAE,KAAK,KACR,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import type { PropertyShapeWire } from '@_linked/core/shapes/nodeShapeWire';
3
+ export interface ToggleEditorProps {
4
+ onPressedChange?: (e: any) => void;
5
+ of?: Record<string, any>;
6
+ property?: PropertyShapeWire;
7
+ children: React.ReactNode;
8
+ /**
9
+ * Converts the value returned by the shape, to the input string for the toggle
10
+ * @param shapePropertyValue
11
+ * @returns
12
+ */
13
+ preConvertValueFn?: (shapePropertyValue: any) => string;
14
+ /**
15
+ * Converts the value of the toggle to a value that can be provided to the set method of the shape
16
+ * @param inputValue
17
+ * @returns
18
+ */
19
+ postConvertValueFn?: (inputValue: string) => any;
20
+ }
21
+ export declare const ToggleEditor: ({ onPressedChange, of, property, children, preConvertValueFn, postConvertValueFn, ...restProps }: ToggleEditorProps) => React.JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Root as Toggle } from '@_linked/primitives/components/Toggle';
3
+ export const ToggleEditor = ({ onPressedChange, of, property, children, preConvertValueFn, postConvertValueFn, ...restProps }) => {
4
+ const onChangeHandler = (value) => {
5
+ console.log(value, 'value toggle');
6
+ if (!of)
7
+ return;
8
+ if (postConvertValueFn) {
9
+ value = postConvertValueFn(value);
10
+ }
11
+ of[property.label] = value;
12
+ console.log(of[property.label], 'of[property.label] toggle');
13
+ if (onPressedChange) {
14
+ onPressedChange(value);
15
+ }
16
+ };
17
+ return (_jsx(Toggle, { pressed: of[property.label], onPressedChange: onChangeHandler, defaultPressed: of
18
+ ? preConvertValueFn
19
+ ? preConvertValueFn(of[property.label])
20
+ : of[property.label]
21
+ : '', ...restProps, children: children }));
22
+ };
23
+ //# sourceMappingURL=ToggleEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToggleEditor.js","sourceRoot":"","sources":["../../../src/components/ToggleEditor.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAqBvE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,eAAe,EACf,EAAE,EACF,QAAQ,EACR,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAClB,GAAG,SAAS,EACM,EAAE,EAAE;IACtB,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,EAAE;QAChC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;QACnC,IAAI,CAAC,EAAE;YAAE,OAAO;QAChB,IAAI,kBAAkB,EAAE,CAAC;YACvB,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC;QACD,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,2BAA2B,CAAC,CAAC;QAE7D,IAAI,eAAe,EAAE,CAAC;YACpB,eAAe,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,MAAM,IACL,OAAO,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAC3B,eAAe,EAAE,eAAe,EAChC,cAAc,EACZ,EAAE;YACA,CAAC,CAAC,iBAAiB;gBACjB,CAAC,CAAC,iBAAiB,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;gBACvC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC;YACtB,CAAC,CAAC,EAAE,KAEJ,SAAS,YAEZ,QAAQ,GACF,CACV,CAAC;AACJ,CAAC,CAAC"}
@@ -54,7 +54,17 @@ export { FormField } from './components/FormField.js';
54
54
  export { default as NodeValuesEditor } from './components/NodeValuesEditor.js';
55
55
  export { NodeBadge } from './components/NodeBadge.js';
56
56
  export { FilterBadge } from './components/FilterBadge.js';
57
+ export { CheckboxEditor } from './components/CheckboxEditor.js';
58
+ export { RadioButtonEditor } from './components/RadioButtonEditor.js';
59
+ export { SelectEditor } from './components/SelectEditor.js';
60
+ export { SwitchEditor } from './components/SwitchEditor.js';
61
+ export { TextareaEditor } from './components/TextareaEditor.js';
62
+ export { ToggleEditor } from './components/ToggleEditor.js';
63
+ export { AvatarEditor } from './components/AvatarEditor.js';
64
+ export { DateEditor } from './components/DateEditor.js';
65
+ export { TextfieldEditor } from './components/TextfieldEditor.js';
57
66
  export * from './shape/contracts.js';
58
67
  export * from './shape/naming.js';
59
68
  export * from './shape/nodeDisplay.js';
60
69
  export * from './shape/propertyVisibility.js';
70
+ export * from './shape/types.js';
package/lib/esm/index.js CHANGED
@@ -53,9 +53,33 @@ export { FormField } from './components/FormField.js';
53
53
  export { default as NodeValuesEditor } from './components/NodeValuesEditor.js';
54
54
  export { NodeBadge } from './components/NodeBadge.js';
55
55
  export { FilterBadge } from './components/FilterBadge.js';
56
+ // Per-datatype value editors. Consumers reach these by direct path
57
+ // (`@_linked/shape-ui/components/SelectEditor`), which only resolves against a
58
+ // built `lib/` if the file is reachable from an entry — so they are exported
59
+ // here as well. Not every one has a consumer in this workspace yet; they are
60
+ // part of the package's surface regardless of who happens to use them today.
61
+ export { CheckboxEditor } from './components/CheckboxEditor.js';
62
+ export { RadioButtonEditor } from './components/RadioButtonEditor.js';
63
+ export { SelectEditor } from './components/SelectEditor.js';
64
+ export { SwitchEditor } from './components/SwitchEditor.js';
65
+ export { TextareaEditor } from './components/TextareaEditor.js';
66
+ export { ToggleEditor } from './components/ToggleEditor.js';
67
+ export { AvatarEditor } from './components/AvatarEditor.js';
68
+ export { DateEditor } from './components/DateEditor.js';
69
+ export { TextfieldEditor } from './components/TextfieldEditor.js';
70
+ // ImageValueEditor is deliberately NOT exported yet. It never compiled — it is
71
+ // written against a core API that has since moved on (`NodeShape.namedNode`,
72
+ // `PropertyShapeWire.uri`, `NodeReferenceValue.label`, `ImageObject.save()`),
73
+ // and it reads instances through `getShapeClass(...).getLocalInstances()`, a
74
+ // live-shape pattern the codebase has moved away from. Exporting it fails the
75
+ // build with 5 type errors. It needs porting, not a compile fix.
56
76
  // ─── Shape domain ────────────────────────────────────────────────────────────
57
77
  export * from './shape/contracts.js';
58
78
  export * from './shape/naming.js';
59
79
  export * from './shape/nodeDisplay.js';
60
80
  export * from './shape/propertyVisibility.js';
81
+ // 1,158 lines of pure shape-domain types plus 13 runtime exports (DATATYPE_MAP,
82
+ // the shape-kind predicates). The consuming app re-exports this whole module
83
+ // for 34 importers, by direct path — so it has to reach lib/.
84
+ export * from './shape/types.js';
61
85
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,8FAA8F;AAC9F,OAAO,cAAc,CAAC;AAWtB,OAAO,EAAC,QAAQ,EAAC,MAAM,WAAW,CAAC;AAGnC,OAAO,EAAC,uBAAuB,EAAE,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAG7E,OAAO,EAAC,cAAc,EAAE,eAAe,EAAC,MAAM,WAAW,CAAC;AAG1D,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,qBAAqB,GACtB,MAAM,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