@forge/react 0.0.0-experimental-9489df9 → 0.0.0-experimental-72f4150

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 (46) hide show
  1. package/CHANGELOG.md +98 -2
  2. package/out/__test__/styles.test.d.ts +2 -0
  3. package/out/__test__/styles.test.d.ts.map +1 -0
  4. package/out/__test__/styles.test.js +90 -0
  5. package/out/components.d.ts +61 -0
  6. package/out/components.d.ts.map +1 -0
  7. package/out/components.js +63 -0
  8. package/out/index.d.ts +4 -0
  9. package/out/index.d.ts.map +1 -0
  10. package/out/index.js +8 -0
  11. package/out/reconciler.d.ts +5 -0
  12. package/out/reconciler.d.ts.map +1 -0
  13. package/out/reconciler.js +144 -0
  14. package/out/styles/index.d.ts +29 -0
  15. package/out/styles/index.d.ts.map +1 -0
  16. package/out/styles/index.js +154 -0
  17. package/out/types/components.d.ts +387 -0
  18. package/out/types/components.d.ts.map +1 -0
  19. package/out/types/components.js +2 -0
  20. package/out/types/effect.d.ts +57 -0
  21. package/out/types/effect.d.ts.map +1 -0
  22. package/out/types/effect.js +23 -0
  23. package/out/types/extension.d.ts +10 -0
  24. package/out/types/extension.d.ts.map +1 -0
  25. package/out/types/extension.js +2 -0
  26. package/out/types/forge.d.ts +146 -0
  27. package/out/types/forge.d.ts.map +1 -0
  28. package/out/types/forge.js +30 -0
  29. package/out/types/icons.d.ts +2 -0
  30. package/out/types/icons.d.ts.map +1 -0
  31. package/out/types/icons.js +2 -0
  32. package/out/types/index.d.ts +11 -0
  33. package/out/types/index.d.ts.map +1 -0
  34. package/out/types/index.js +28 -0
  35. package/out/types/legacy-effect.d.ts +40 -0
  36. package/out/types/legacy-effect.d.ts.map +1 -0
  37. package/out/types/legacy-effect.js +25 -0
  38. package/out/types/styles.d.ts +154 -0
  39. package/out/types/styles.d.ts.map +1 -0
  40. package/out/types/styles.js +2 -0
  41. package/package.json +4 -3
  42. package/tsconfig.tsbuildinfo +1 -0
  43. package/src/globals.d.ts +0 -12
  44. package/src/index.ts +0 -1
  45. package/src/reconciler.ts +0 -219
  46. package/tsconfig.json +0 -9
package/CHANGELOG.md CHANGED
@@ -1,10 +1,106 @@
1
1
  # @forge/react
2
2
 
3
- ## 0.0.0-experimental-9489df9
3
+ ## 0.0.0-experimental-72f4150
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - @forge/ui@0.0.0-experimental-9489df9
7
+ - 016712d: Fail gracefully if the forge bridge is not available
8
+
9
+ ## 3.0.1-next.0
10
+
11
+ ### Patch Changes
12
+
13
+ - 016712d: Fail gracefully if the forge bridge is not available
14
+
15
+ ## 3.0.0
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [1caf716]
20
+ - @forge/ui@1.6.0
21
+
22
+ ## 3.0.0-next.0
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies [1caf7166]
27
+ - @forge/ui@1.6.0-next.0
28
+
29
+ ## 2.1.0
30
+
31
+ ### Minor Changes
32
+
33
+ - 120b3ca: Bump forge-ui version in bundle script
34
+
35
+ ## 2.1.0-next.0
36
+
37
+ ### Minor Changes
38
+
39
+ - 120b3ca3: Bump forge-ui version in bundle script
40
+
41
+ ## 2.0.0
42
+
43
+ ### Minor Changes
44
+
45
+ - 782f6b8: Add HorizontalLayout and VerticalLayout components
46
+
47
+ ### Patch Changes
48
+
49
+ - 8f90136: Remove flexWrap property on HorizontalLayout component
50
+ - Updated dependencies [be216ec]
51
+ - @forge/ui@1.5.0
52
+
53
+ ## 2.0.0-next.2
54
+
55
+ ### Patch Changes
56
+
57
+ - Updated dependencies [be216ec6]
58
+ - @forge/ui@1.5.0-next.0
59
+
60
+ ## 1.2.0-next.1
61
+
62
+ ### Patch Changes
63
+
64
+ - 8f90136c: Remove flexWrap property on HorizontalLayout component
65
+
66
+ ## 1.2.0-next.0
67
+
68
+ ### Minor Changes
69
+
70
+ - 782f6b8: Add HorizontalLayout and VerticalLayout components
71
+
72
+ ## 1.1.0
73
+
74
+ ### Minor Changes
75
+
76
+ - 568a437: Added stylesheet helper methods
77
+ - c72e774: Initial component export for @forge/react library.
78
+
79
+ ## 1.1.0-next.1
80
+
81
+ ### Minor Changes
82
+
83
+ - c72e774: Initial component export for @forge/react library.
84
+
85
+ ## 1.1.0-next.0
86
+
87
+ ### Minor Changes
88
+
89
+ - 568a4370: Added stylesheet helper methods
90
+
91
+ ## 1.0.0
92
+
93
+ ### Patch Changes
94
+
95
+ - Updated dependencies [da4c64d]
96
+ - @forge/ui@1.4.0
97
+
98
+ ## 1.0.0-next.1
99
+
100
+ ### Patch Changes
101
+
102
+ - Updated dependencies [da4c64d]
103
+ - @forge/ui@1.4.0-next.1
8
104
 
9
105
  ## 1.0.0-next.0
10
106
 
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=styles.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.test.d.ts","sourceRoot":"","sources":["../../src/__test__/styles.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const styles_1 = require("../styles");
4
+ const redHexCode = '#FF0000';
5
+ const blueHexCode = '#0000FF';
6
+ describe('StyleSheet', () => {
7
+ it('should create valid basic styles object', () => {
8
+ expect(styles_1.StyleSheet.create({
9
+ container: {
10
+ backgroundColor: '#fff',
11
+ backgroundImage: [
12
+ (0, styles_1.url)('/image.png'),
13
+ (0, styles_1.linearGradient)('90deg', (0, styles_1.gradientStep)('10%', redHexCode), (0, styles_1.gradientStep)('30%', blueHexCode))
14
+ ],
15
+ backgroundSize: ['cover', ['50%', '50%']]
16
+ }
17
+ })).toEqual({
18
+ container: {
19
+ backgroundColor: '#fff',
20
+ backgroundImage: [
21
+ { method: 'url', value: { path: '/image.png' } },
22
+ {
23
+ method: 'gradient',
24
+ value: {
25
+ colors: [
26
+ { percent: '10%', value: redHexCode },
27
+ { percent: '30%', value: blueHexCode }
28
+ ],
29
+ degrees: '90deg',
30
+ type: 'linear'
31
+ }
32
+ }
33
+ ],
34
+ backgroundSize: ['cover', ['50%', '50%']]
35
+ }
36
+ });
37
+ });
38
+ it('should create valid composed styles object', () => {
39
+ expect(styles_1.StyleSheet.create({
40
+ container: (compose) => compose({
41
+ backgroundColor: redHexCode,
42
+ backgroundImage: (0, styles_1.url)('https://example.test/image.png'),
43
+ backgroundPosition: ['50px', '50px', '50px', '50px'],
44
+ transform: [
45
+ (0, styles_1.translate)('10px', '10px', '10px'),
46
+ (0, styles_1.scale)('2', '2', '2'),
47
+ (0, styles_1.rotate)('45deg', '45deg', '45deg'),
48
+ (0, styles_1.skew)('45deg', '45deg')
49
+ ]
50
+ }, (0, styles_1.active)({
51
+ backgroundColor: (0, styles_1.rgba)(0, 0, 255, 1),
52
+ backgroundImage: (0, styles_1.radialGradient)((0, styles_1.gradientStep)('10%', redHexCode), (0, styles_1.gradientStep)('30%', blueHexCode)),
53
+ backgroundPosition: ['50px', '50px']
54
+ }), (0, styles_1.hover)({
55
+ backgroundPosition: 'center',
56
+ backgroundRepeat: 'no-repeat'
57
+ }), (0, styles_1.focus)({
58
+ backgroundRepeat: ['repeat', 'repeat']
59
+ }))
60
+ })).toEqual({
61
+ container: {
62
+ __active: {
63
+ backgroundColor: { method: 'rgba', value: { a: 1, b: 255, g: 0, r: 0 } },
64
+ backgroundImage: {
65
+ method: 'gradient',
66
+ value: {
67
+ colors: [
68
+ { percent: '10%', value: redHexCode },
69
+ { percent: '30%', value: blueHexCode }
70
+ ],
71
+ type: 'radial'
72
+ }
73
+ },
74
+ backgroundPosition: ['50px', '50px']
75
+ },
76
+ __focus: { backgroundRepeat: ['repeat', 'repeat'] },
77
+ __hover: { backgroundPosition: 'center', backgroundRepeat: 'no-repeat' },
78
+ backgroundColor: redHexCode,
79
+ backgroundImage: { method: 'url', value: { path: 'https://example.test/image.png' } },
80
+ backgroundPosition: ['50px', '50px', '50px', '50px'],
81
+ transform: [
82
+ { method: 'translate', value: { x: '10px', y: '10px', z: '10px' } },
83
+ { method: 'scale', value: { x: '2', y: '2', z: '2' } },
84
+ { method: 'rotate', value: { x: '45deg', y: '45deg', z: '45deg' } },
85
+ { method: 'skew', value: { x: '45deg', y: '45deg' } }
86
+ ]
87
+ }
88
+ });
89
+ });
90
+ });
@@ -0,0 +1,61 @@
1
+ import { BadgeProps, ButtonSetProps, CellProps, DateLozengeProps, ForgeElement, FormData, FormProps, FrameProps, HeadProps, HeadingProps, InlineDialogProps, MarkupProps, ModalDialogProps, NativeBoxProps as BoxProps, NativeButtonProps as ButtonProps, NativeCheckboxGroupProps as CheckboxGroupProps, NativeCheckboxProps as CheckboxProps, NativeDatePickerProps as DatePickerProps, NativeImageProps as ImageProps, NativeLinkProps as LinkProps, NativeRadioGroupProps as RadioGroupProps, NativeRangeProps as RangeProps, NativeSelectProps as SelectProps, NativeTextAreaProps as TextAreaProps, NativeTextFieldProps as TextFieldProps, NativeTextProps as TextProps, NativeToggleProps as ToggleProps, NativeUserPickerProps as UserPickerProps, NativePressableProps as PressableProps, OptionProps, RadioProps, RowProps, SectionMessageProps, TabProps, TableProps, TabsProps, TagGroupProps, TooltipProps, UserGroupProps, UserProps, ForgeChildren, AllowedPrimitives } from './types';
2
+ import { NativeCodeProps, NativeStatusLozengeProps, NativeTagProps } from './types';
3
+ export { UserPickerValue, PressableAppearance } from './types';
4
+ export declare const Box: (props: BoxProps) => ForgeElement;
5
+ export declare const Button: (props: ButtonProps) => ForgeElement;
6
+ export declare const Checkbox: (props: CheckboxProps) => ForgeElement;
7
+ export declare const CheckboxGroup: (props: CheckboxGroupProps) => ForgeElement;
8
+ export declare const DatePicker: (props: DatePickerProps) => ForgeElement;
9
+ export declare const Form: <T extends FormData>(props: FormProps<T>) => ForgeElement;
10
+ export declare const Frame: (props: FrameProps) => ForgeElement;
11
+ export declare const Image: (props: ImageProps) => ForgeElement;
12
+ export declare const Link: (props: LinkProps) => ForgeElement;
13
+ export declare const ModalDialog: (props: ModalDialogProps) => ForgeElement;
14
+ export declare const RadioGroup: (props: RadioGroupProps) => ForgeElement;
15
+ export declare const Range: (props: RangeProps) => ForgeElement;
16
+ export declare const Select: (props: SelectProps) => ForgeElement;
17
+ export declare const Text: (props: TextProps) => ForgeElement;
18
+ export declare const TextArea: (props: TextAreaProps) => ForgeElement;
19
+ export declare const TextField: (props: TextFieldProps) => ForgeElement;
20
+ export declare const Toggle: (props: ToggleProps) => ForgeElement;
21
+ export declare const UserPicker: (props: UserPickerProps) => ForgeElement;
22
+ export declare const Pressable: (props: PressableProps) => ForgeElement;
23
+ export declare const Badge: (props: BadgeProps) => ForgeElement;
24
+ export declare const ButtonSet: (props: ButtonSetProps) => ForgeElement;
25
+ export declare const Code: (props: NativeCodeProps) => ForgeElement;
26
+ export declare const DateLozenge: (props: DateLozengeProps) => ForgeElement;
27
+ export declare const Heading: (props: HeadingProps) => ForgeElement;
28
+ export declare const InlineDialog: (props: InlineDialogProps) => ForgeElement;
29
+ export declare const Option: (props: OptionProps) => ForgeElement;
30
+ export declare const Radio: (props: RadioProps) => ForgeElement;
31
+ export declare const SectionMessage: (props: SectionMessageProps) => ForgeElement;
32
+ export declare const StatusLozenge: (props: NativeStatusLozengeProps) => ForgeElement;
33
+ export declare const Tooltip: (props: TooltipProps) => ForgeElement;
34
+ export declare const Em: (props: MarkupProps) => ForgeElement;
35
+ export declare const Strike: (props: MarkupProps) => ForgeElement;
36
+ export declare const Strong: (props: MarkupProps) => ForgeElement;
37
+ export declare const Tab: (props: TabProps) => ForgeElement;
38
+ export declare const Tabs: (props: TabsProps) => ForgeElement;
39
+ export declare const Cell: (props: CellProps) => ForgeElement;
40
+ export declare const Head: (props: HeadProps) => ForgeElement;
41
+ export declare const Row: (props: RowProps) => ForgeElement;
42
+ export declare const Table: (props: TableProps) => ForgeElement;
43
+ export declare const Tag: (props: NativeTagProps) => ForgeElement;
44
+ export declare const TagGroup: (props: TagGroupProps) => ForgeElement;
45
+ export declare const User: (props: UserProps) => ForgeElement;
46
+ export declare const UserGroup: (props: UserGroupProps) => ForgeElement;
47
+ interface HorizontalLayoutProps {
48
+ gap?: AllowedPrimitives['gap'];
49
+ horizontalAlignment?: AllowedPrimitives['justifyContent'];
50
+ verticalAlignment?: AllowedPrimitives['alignItems'];
51
+ children: ForgeChildren;
52
+ }
53
+ export declare const HorizontalLayout: ({ gap, horizontalAlignment, verticalAlignment, children }: HorizontalLayoutProps) => ForgeElement;
54
+ interface VerticalLayoutProps {
55
+ gap?: AllowedPrimitives['gap'];
56
+ verticalAlignment?: AllowedPrimitives['justifyContent'];
57
+ horizontalAlignment?: AllowedPrimitives['alignItems'];
58
+ children: ForgeChildren;
59
+ }
60
+ export declare const VerticalLayout: ({ gap, horizontalAlignment, verticalAlignment, children }: VerticalLayoutProps) => ForgeElement;
61
+ //# sourceMappingURL=components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,UAAU,EACV,SAAS,EACT,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,cAAc,IAAI,QAAQ,EAC1B,iBAAiB,IAAI,WAAW,EAChC,wBAAwB,IAAI,kBAAkB,EAC9C,mBAAmB,IAAI,aAAa,EACpC,qBAAqB,IAAI,eAAe,EACxC,gBAAgB,IAAI,UAAU,EAC9B,eAAe,IAAI,SAAS,EAC5B,qBAAqB,IAAI,eAAe,EACxC,gBAAgB,IAAI,UAAU,EAC9B,iBAAiB,IAAI,WAAW,EAChC,mBAAmB,IAAI,aAAa,EACpC,oBAAoB,IAAI,cAAc,EACtC,eAAe,IAAI,SAAS,EAC5B,iBAAiB,IAAI,WAAW,EAChC,qBAAqB,IAAI,eAAe,EACxC,oBAAoB,IAAI,cAAc,EACtC,WAAW,EACX,UAAU,EACV,QAAQ,E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CAAC;AAEjF,eAAO,MAAM,GAAG,UAAiC,cAAc,KAAK,YAAY,CAAC;AACjF,eAAO,MAAM,QAAQ,UAAsC,aAAa,KAAK,YAAY,CAAC;AAE1F,eAAO,MAAM,IAAI,UAAkC,SAAS,KAAK,YAAY,CAAC;AAC9E,eAAO,MAAM,SAAS,UAAuC,cAAc,KAAK,YAAY,CAAC;AAE7F,UAAU,qBAAqB;IAC7B,GAAG,CAAC,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC/B,mBAAmB,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IAC1D,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC;IACpD,QAAQ,EAAE,aAAa,CAAC;CACzB;AAED,eAAO,MAAM,gBAAgB,8DAK1B,qBAAqB,KAAG,YAY1B,CAAC;AAEF,UAAU,mBAAmB;IAC3B,GAAG,CAAC,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC/B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IACxD,mBAAmB,CAAC,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC;IACtD,QAAQ,EAAE,aAAa,CAAC;CACzB;AAED,eAAO,MAAM,cAAc,8DAKxB,mBAAmB,KAAG,YAYxB,CAAC"}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VerticalLayout = exports.HorizontalLayout = exports.UserGroup = exports.User = exports.TagGroup = exports.Tag = exports.Table = exports.Row = exports.Head = exports.Cell = exports.Tabs = exports.Tab = exports.Strong = exports.Strike = exports.Em = exports.Tooltip = exports.StatusLozenge = exports.SectionMessage = exports.Radio = exports.Option = exports.InlineDialog = exports.Heading = exports.DateLozenge = exports.Code = exports.ButtonSet = exports.Badge = exports.Pressable = exports.UserPicker = exports.Toggle = exports.TextField = exports.TextArea = exports.Text = exports.Select = exports.Range = exports.RadioGroup = exports.ModalDialog = exports.Link = exports.Image = exports.Frame = exports.Form = exports.DatePicker = exports.CheckboxGroup = exports.Checkbox = exports.Button = exports.Box = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ exports.Box = 'Box';
6
+ exports.Button = 'Button';
7
+ exports.Checkbox = 'Checkbox';
8
+ exports.CheckboxGroup = 'CheckboxGroup';
9
+ exports.DatePicker = 'DatePicker';
10
+ exports.Form = 'Form';
11
+ exports.Frame = 'Frame';
12
+ exports.Image = 'Image';
13
+ exports.Link = 'Link';
14
+ exports.ModalDialog = 'ModalDialog';
15
+ exports.RadioGroup = 'RadioGroup';
16
+ exports.Range = 'Range';
17
+ exports.Select = 'Select';
18
+ exports.Text = 'Text';
19
+ exports.TextArea = 'TextArea';
20
+ exports.TextField = 'TextField';
21
+ exports.Toggle = 'Toggle';
22
+ exports.UserPicker = 'UserPicker';
23
+ exports.Pressable = 'Pressable';
24
+ exports.Badge = 'Badge';
25
+ exports.ButtonSet = 'ButtonSet';
26
+ exports.Code = 'Code';
27
+ exports.DateLozenge = 'DateLozenge';
28
+ exports.Heading = 'Heading';
29
+ exports.InlineDialog = 'InlineDialog';
30
+ exports.Option = 'Option';
31
+ exports.Radio = 'Radio';
32
+ exports.SectionMessage = 'SectionMessage';
33
+ exports.StatusLozenge = 'StatusLozenge';
34
+ exports.Tooltip = 'Tooltip';
35
+ exports.Em = 'Em';
36
+ exports.Strike = 'Strike';
37
+ exports.Strong = 'Strong';
38
+ exports.Tab = 'Tab';
39
+ exports.Tabs = 'Tabs';
40
+ exports.Cell = 'Cell';
41
+ exports.Head = 'Head';
42
+ exports.Row = 'Row';
43
+ exports.Table = 'Table';
44
+ exports.Tag = 'Tag';
45
+ exports.TagGroup = 'TagGroup';
46
+ exports.User = 'User';
47
+ exports.UserGroup = 'UserGroup';
48
+ const HorizontalLayout = ({ gap, horizontalAlignment, verticalAlignment, children }) => ((0, jsx_runtime_1.jsx)(exports.Box, Object.assign({ style: {
49
+ display: 'flex',
50
+ flexDirection: 'row',
51
+ gap,
52
+ justifyContent: horizontalAlignment,
53
+ alignItems: verticalAlignment
54
+ } }, { children: children })));
55
+ exports.HorizontalLayout = HorizontalLayout;
56
+ const VerticalLayout = ({ gap, horizontalAlignment, verticalAlignment, children }) => ((0, jsx_runtime_1.jsx)(exports.Box, Object.assign({ style: {
57
+ display: 'flex',
58
+ flexDirection: 'column',
59
+ gap,
60
+ justifyContent: verticalAlignment,
61
+ alignItems: horizontalAlignment
62
+ } }, { children: children })));
63
+ exports.VerticalLayout = VerticalLayout;
package/out/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ export { ForgeReconciler as default } from './reconciler';
2
+ export * from './styles';
3
+ export * from './components';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAE1D,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC"}
package/out/index.js ADDED
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = void 0;
4
+ const tslib_1 = require("tslib");
5
+ var reconciler_1 = require("./reconciler");
6
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return reconciler_1.ForgeReconciler; } });
7
+ tslib_1.__exportStar(require("./styles"), exports);
8
+ tslib_1.__exportStar(require("./components"), exports);
@@ -0,0 +1,5 @@
1
+ export declare const ForgeReconciler: {
2
+ render: (element: any) => void;
3
+ };
4
+ export default ForgeReconciler;
5
+ //# sourceMappingURL=reconciler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reconciler.d.ts","sourceRoot":"","sources":["../src/reconciler.ts"],"names":[],"mappings":"AAsMA,eAAO,MAAM,eAAe;sBACR,GAAG,KAAG,IAAI;CAiB7B,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ForgeReconciler = void 0;
5
+ const tslib_1 = require("tslib");
6
+ const react_reconciler_1 = tslib_1.__importDefault(require("react-reconciler"));
7
+ const constants_1 = require("react-reconciler/constants");
8
+ const uuid_1 = require("uuid");
9
+ const callBridge = (_a = self.__bridge) === null || _a === void 0 ? void 0 : _a.callBridge;
10
+ const createElement = (type, props = {}) => {
11
+ const { children } = props, restProps = tslib_1.__rest(props, ["children"]);
12
+ return {
13
+ type,
14
+ children: [],
15
+ props: restProps,
16
+ key: (0, uuid_1.v4)()
17
+ };
18
+ };
19
+ const appendChild = (parent, child) => {
20
+ if (parent.children.includes(child)) {
21
+ const removeIndex = parent.children.indexOf(child);
22
+ parent.children.splice(removeIndex, 1);
23
+ }
24
+ parent.children.push(child);
25
+ };
26
+ const insertBefore = (parent, child, beforeChild) => {
27
+ const insertIndex = parent.children.indexOf(beforeChild);
28
+ if (parent.children.includes(child)) {
29
+ const removeIndex = parent.children.indexOf(child);
30
+ parent.children.splice(removeIndex, 1);
31
+ }
32
+ parent.children.splice(insertIndex, 0, child);
33
+ };
34
+ const hostConfig = {
35
+ supportsMutation: true,
36
+ supportsPersistence: false,
37
+ noTimeout: -1,
38
+ isPrimaryRenderer: false,
39
+ supportsHydration: false,
40
+ resetAfterCommit(forgeDoc) {
41
+ callBridge('reconcile', { forgeDoc });
42
+ },
43
+ createInstance(type, props) {
44
+ const element = createElement(type, props);
45
+ return element;
46
+ },
47
+ createTextInstance(text) {
48
+ return {
49
+ type: 'String',
50
+ children: [],
51
+ props: {
52
+ text
53
+ },
54
+ key: (0, uuid_1.v4)()
55
+ };
56
+ },
57
+ appendInitialChild(parent, child) {
58
+ appendChild(parent, child);
59
+ },
60
+ appendChild(parent, child) {
61
+ appendChild(parent, child);
62
+ },
63
+ appendChildToContainer(container, child) {
64
+ appendChild(container, child);
65
+ },
66
+ finalizeInitialChildren() {
67
+ return false;
68
+ },
69
+ prepareUpdate(instance, type, oldProps, newProps) {
70
+ instance.props = newProps;
71
+ return newProps;
72
+ },
73
+ shouldSetTextContent() {
74
+ return false;
75
+ },
76
+ getRootHostContext() {
77
+ return {};
78
+ },
79
+ getChildHostContext(parentContext, fiberType) {
80
+ return null;
81
+ },
82
+ getPublicInstance(instance) {
83
+ return instance;
84
+ },
85
+ prepareForCommit() {
86
+ return null;
87
+ },
88
+ preparePortalMount() { },
89
+ scheduleTimeout(fn, delay) {
90
+ return setTimeout(fn, delay);
91
+ },
92
+ cancelTimeout(id) {
93
+ clearTimeout(id);
94
+ },
95
+ insertBefore(parent, child, beforeChild) {
96
+ insertBefore(parent, child, beforeChild);
97
+ },
98
+ insertInContainerBefore(container, child, beforeChild) {
99
+ insertBefore(container, child, beforeChild);
100
+ },
101
+ removeChild(parent, child) {
102
+ const removeIndex = parent.children.indexOf(child);
103
+ parent.children.splice(removeIndex, 1);
104
+ },
105
+ removeChildFromContainer(container, child) {
106
+ const removeIndex = container.children.indexOf(child);
107
+ container.children.splice(removeIndex, 1);
108
+ },
109
+ resetTextContent() { },
110
+ commitTextUpdate(textInstance, oldText, newText) {
111
+ textInstance.props.text = newText;
112
+ },
113
+ commitMount() { },
114
+ commitUpdate() { },
115
+ hideInstance() { },
116
+ hideTextInstance() { },
117
+ unhideInstance() { },
118
+ unhideTextInstance() { },
119
+ clearContainer() { },
120
+ detachDeletedInstance(instance) { },
121
+ getCurrentEventPriority() {
122
+ return constants_1.DefaultEventPriority;
123
+ },
124
+ getInstanceFromNode() {
125
+ return null;
126
+ },
127
+ beforeActiveInstanceBlur() { },
128
+ afterActiveInstanceBlur() { },
129
+ prepareScopeUpdate() { },
130
+ getInstanceFromScope() {
131
+ return null;
132
+ }
133
+ };
134
+ const reconciler = (0, react_reconciler_1.default)(hostConfig);
135
+ exports.ForgeReconciler = {
136
+ render: (element) => {
137
+ const rootElement = createElement('Root');
138
+ const container = reconciler.createContainer(rootElement, 0, null, false, null, 'root', (err) => {
139
+ console.log(err);
140
+ }, null);
141
+ reconciler.updateContainer(element, container, null, null);
142
+ }
143
+ };
144
+ exports.default = exports.ForgeReconciler;
@@ -0,0 +1,29 @@
1
+ import { AllowedPrimitives, Definitions, GradientValue, RGBAColorValue, ShadowValue, TransformValue, ColorType, URLValue } from '../types';
2
+ export { AllowedPrimitives } from '../types';
3
+ export interface PreDefinitions {
4
+ [key: string]: AllowedPrimitives | ComposeProvider;
5
+ }
6
+ export declare type Compose = (...primitiveObjects: AllowedPrimitives[]) => AllowedPrimitives;
7
+ export declare type ComposeProvider = (compose: Compose) => AllowedPrimitives;
8
+ export declare const StyleSheet: {
9
+ create(definitions: PreDefinitions): Definitions;
10
+ };
11
+ export declare const rgba: (r: number, g: number, b: number, a: number) => RGBAColorValue;
12
+ export declare const rgb: (r: number, g: number, b: number) => RGBAColorValue;
13
+ export declare function shadow(offsets: string, color: ColorType): ShadowValue;
14
+ export interface GradientStep {
15
+ percent: string;
16
+ value: ColorType;
17
+ }
18
+ export declare function gradientStep(percent: string, value: ColorType): GradientStep;
19
+ export declare function linearGradient(degrees: string, ...steps: GradientStep[]): GradientValue;
20
+ export declare function radialGradient(...steps: GradientStep[]): GradientValue;
21
+ export declare function translate(x?: string, y?: string, z?: string): TransformValue;
22
+ export declare function scale(x?: string, y?: string, z?: string): TransformValue;
23
+ export declare function rotate(x?: string, y?: string, z?: string): TransformValue;
24
+ export declare function skew(x?: string, y?: string): TransformValue;
25
+ export declare function url(path: string): URLValue;
26
+ export declare function focus(primitives: AllowedPrimitives): AllowedPrimitives;
27
+ export declare function hover(primitives: AllowedPrimitives): AllowedPrimitives;
28
+ export declare function active(primitives: AllowedPrimitives): AllowedPrimitives;
29
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/styles/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,a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