@draftbit/core 46.4.4-04eaf1.2 → 46.4.4-0d37af.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.
@@ -24,10 +24,14 @@ class Text extends React.Component {
24
24
  super(...arguments);
25
25
 
26
26
  _defineProperty(this, "_root", void 0);
27
+
28
+ _defineProperty(this, "state", {
29
+ nativeProps: {}
30
+ });
27
31
  }
28
32
 
29
33
  setNativeProps(args) {
30
- return this._root && this._root.setNativeProps(args);
34
+ this.state.nativeProps = args || {};
31
35
  }
32
36
 
33
37
  render() {
@@ -36,7 +40,7 @@ class Text extends React.Component {
36
40
  ...rest
37
41
  } = this.props;
38
42
  const writingDirection = _reactNative.I18nManager.isRTL ? "rtl" : "ltr";
39
- return /*#__PURE__*/React.createElement(_reactNative.Text, _extends({}, rest, {
43
+ return /*#__PURE__*/React.createElement(_reactNative.Text, _extends({}, rest, this.state.nativeProps, {
40
44
  ref: c => {
41
45
  this._root = c;
42
46
  },
@@ -32,6 +32,7 @@ class TextField extends React.Component {
32
32
  super(...arguments);
33
33
 
34
34
  _defineProperty(this, "state", {
35
+ nativeProps: {},
35
36
  labeled: new _reactNative.Animated.Value(this.props.value || this.props.error ? 0 : 1),
36
37
  focused: false,
37
38
  placeholder: this.props.error ? this.props.placeholder : "",
@@ -162,7 +163,9 @@ class TextField extends React.Component {
162
163
  * @internal
163
164
  */
164
165
  setNativeProps(args) {
165
- return this._root && this._root.setNativeProps(args);
166
+ this.setState(state => ({ ...state,
167
+ nativeState: args || {}
168
+ }));
166
169
  }
167
170
 
168
171
  isFocused() {
@@ -444,6 +447,7 @@ class TextField extends React.Component {
444
447
  underlineColorAndroid: "transparent",
445
448
  style: inputStyles,
446
449
  ...rest,
450
+ ...this.state.nativeProps,
447
451
  value: this.state.value
448
452
  })), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
449
453
  name: rightIconName,
@@ -1,5 +1,3 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  /* Copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx */
4
2
  import * as React from "react";
5
3
  import { Animated, StyleSheet } from "react-native";
@@ -38,6 +36,22 @@ const Surface = _ref => {
38
36
  }
39
37
  };
40
38
 
39
+ return /*#__PURE__*/React.createElement(Animated.View, { ...rest,
40
+ style: [{
41
+ backgroundColor: getBackgroundColor(),
42
+ elevation,
43
+ ...evalationStyles,
44
+ ...restStyle
45
+ }]
46
+ }, children);
47
+ };
48
+
49
+ export default withTheme(Surface); overlay(elevation, colors.surface);
50
+ } else {
51
+ return colors.surface;
52
+ }
53
+ };
54
+
41
55
  return /*#__PURE__*/React.createElement(Animated.View, _extends({}, rest, {
42
56
  style: [{
43
57
  backgroundColor: getBackgroundColor(),
@@ -1,5 +1,3 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  import * as React from "react";
4
2
  import { Switch as NativeSwitch } from "react-native";
5
3
  import { withTheme } from "../theming";
@@ -39,23 +37,24 @@ function Switch(_ref) {
39
37
  setChecked(Boolean(defaultValue));
40
38
  }
41
39
  }, [defaultValue, previousDefaultValue]);
42
- return /*#__PURE__*/React.createElement(NativeSwitch, _extends({
40
+ return /*#__PURE__*/React.createElement(NativeSwitch, {
43
41
  value: checked,
44
42
  disabled: disabled,
45
43
  trackColor: {
46
44
  false: inactiveTrackThemeColor,
47
45
  true: activeTrackThemeColor
48
46
  },
49
- thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor // @ts-ignore react-native-web only
50
- ,
47
+ thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor,
48
+ // @ts-ignore react-native-web only
51
49
  activeThumbColor: activeThumbThemeColor,
52
50
  ios_backgroundColor: inactiveTrackThemeColor,
53
51
  style: style,
54
52
  onValueChange: bool => {
55
53
  setChecked(bool);
56
54
  onValueChange && onValueChange(bool);
57
- }
58
- }, rest));
55
+ },
56
+ ...rest
57
+ });
59
58
  }
60
59
 
61
60
  function Row(_ref2) {
@@ -85,7 +84,7 @@ function Row(_ref2) {
85
84
  setChecked(defaultValue);
86
85
  }
87
86
  }, [defaultValue]);
88
- return /*#__PURE__*/React.createElement(FormRow, _extends({
87
+ return /*#__PURE__*/React.createElement(FormRow, {
89
88
  disabled: disabled,
90
89
  onPress: () => {
91
90
  setChecked(!checked);
@@ -93,8 +92,9 @@ function Row(_ref2) {
93
92
  },
94
93
  label: label,
95
94
  direction: direction,
96
- style: style
97
- }, rest), /*#__PURE__*/React.createElement(Switch, {
95
+ style: style,
96
+ ...rest
97
+ }, /*#__PURE__*/React.createElement(Switch, {
98
98
  theme: theme,
99
99
  value: checked,
100
100
  disabled: disabled,
@@ -106,6 +106,19 @@ function Row(_ref2) {
106
106
  }));
107
107
  }
108
108
 
109
+ const SwitchRow = withTheme(Row);
110
+ export { SwitchRow };
111
+ export default withTheme(Switch);me,
112
+ value: checked,
113
+ disabled: disabled,
114
+ onValueChange: onValueChange,
115
+ activeTrackColor: activeTrackColor,
116
+ inactiveTrackColor: inactiveTrackColor,
117
+ activeThumbColor: activeThumbColor,
118
+ inactiveThumbColor: inactiveThumbColor
119
+ }));
120
+ }
121
+
109
122
  const SwitchRow = withTheme(Row);
110
123
  export { SwitchRow };
111
124
  export default withTheme(Switch);
@@ -11,10 +11,14 @@ class Text extends React.Component {
11
11
  super(...arguments);
12
12
 
13
13
  _defineProperty(this, "_root", void 0);
14
+
15
+ _defineProperty(this, "state", {
16
+ nativeProps: {}
17
+ });
14
18
  }
15
19
 
16
20
  setNativeProps(args) {
17
- return this._root && this._root.setNativeProps(args);
21
+ this.state.nativeProps = args || {};
18
22
  }
19
23
 
20
24
  render() {
@@ -23,7 +27,7 @@ class Text extends React.Component {
23
27
  ...rest
24
28
  } = this.props;
25
29
  const writingDirection = I18nManager.isRTL ? "rtl" : "ltr";
26
- return /*#__PURE__*/React.createElement(NativeText, _extends({}, rest, {
30
+ return /*#__PURE__*/React.createElement(NativeText, _extends({}, rest, this.state.nativeProps, {
27
31
  ref: c => {
28
32
  this._root = c;
29
33
  },
@@ -16,6 +16,7 @@ class TextField extends React.Component {
16
16
  super(...arguments);
17
17
 
18
18
  _defineProperty(this, "state", {
19
+ nativeProps: {},
19
20
  labeled: new Animated.Value(this.props.value || this.props.error ? 0 : 1),
20
21
  focused: false,
21
22
  placeholder: this.props.error ? this.props.placeholder : "",
@@ -146,7 +147,9 @@ class TextField extends React.Component {
146
147
  * @internal
147
148
  */
148
149
  setNativeProps(args) {
149
- return this._root && this._root.setNativeProps(args);
150
+ this.setState(state => ({ ...state,
151
+ nativeState: args || {}
152
+ }));
150
153
  }
151
154
 
152
155
  isFocused() {
@@ -426,6 +429,7 @@ class TextField extends React.Component {
426
429
  underlineColorAndroid: "transparent",
427
430
  style: inputStyles,
428
431
  ...rest,
432
+ ...this.state.nativeProps,
429
433
  value: this.state.value
430
434
  })), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
431
435
  name: rightIconName,
@@ -6,7 +6,8 @@ declare type Props = {
6
6
  } & TextProps;
7
7
  declare class Text extends React.Component<Props> {
8
8
  _root: any;
9
- setNativeProps(args: TextProps): any;
9
+ state: any;
10
+ setNativeProps(args: TextProps): void;
10
11
  render(): JSX.Element;
11
12
  }
12
13
  export declare const BaseLink: ({ style, theme, title, ...props }: any) => JSX.Element;
@@ -27,6 +27,7 @@ export declare type Props = {
27
27
  }) => React.ReactNode;
28
28
  } & TextInputProps & IconSlot;
29
29
  interface State {
30
+ nativeProps: any;
30
31
  labeled: Animated.Value;
31
32
  focused?: boolean;
32
33
  placeholder?: string | undefined;
@@ -57,7 +58,7 @@ declare class TextField extends React.Component<Props, State> {
57
58
  /**
58
59
  * @internal
59
60
  */
60
- setNativeProps(args: Props): void | undefined;
61
+ setNativeProps(args: Props): void;
61
62
  isFocused(): boolean | undefined;
62
63
  clear(): void | undefined;
63
64
  focus(): void | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.4.4-04eaf1.2+04eaf19",
3
+ "version": "46.4.4-0d37af.2+0d37af2",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -41,8 +41,7 @@
41
41
  "dependencies": {
42
42
  "@date-io/date-fns": "^1.3.13",
43
43
  "@draftbit/react-theme-provider": "^2.1.1",
44
- "@draftbit/types": "^46.4.4-04eaf1.2+04eaf19",
45
- "@expo/html-elements": "^0.2.0",
44
+ "@draftbit/types": "^46.4.4-0d37af.2+0d37af2",
46
45
  "@material-ui/core": "^4.11.0",
47
46
  "@material-ui/pickers": "^3.2.10",
48
47
  "@react-native-community/slider": "4.2.3",
@@ -82,5 +81,5 @@
82
81
  ]
83
82
  ]
84
83
  },
85
- "gitHead": "04eaf19a6f0f35bb910fbe3bd16d8f5be1b5fb55"
84
+ "gitHead": "0d37af2ae42b9d9c861a5cbc53ddedfac3da7de5"
86
85
  }
@@ -2,13 +2,19 @@ import * as React from "react";
2
2
  import { Text as NativeText, I18nManager } from "react-native";
3
3
  import { withTheme } from "../theming";
4
4
  class Text extends React.Component {
5
+ constructor() {
6
+ super(...arguments);
7
+ this.state = {
8
+ nativeProps: {},
9
+ };
10
+ }
5
11
  setNativeProps(args) {
6
- return this._root && this._root.setNativeProps(args);
12
+ this.state.nativeProps = args || {};
7
13
  }
8
14
  render() {
9
15
  const { style, ...rest } = this.props;
10
16
  const writingDirection = I18nManager.isRTL ? "rtl" : "ltr";
11
- return (React.createElement(NativeText, { ...rest, ref: (c) => {
17
+ return (React.createElement(NativeText, { ...rest, ...this.state.nativeProps, ref: (c) => {
12
18
  this._root = c;
13
19
  }, style: [
14
20
  {
@@ -10,8 +10,12 @@ type Props = {
10
10
  class Text extends React.Component<Props> {
11
11
  _root: any;
12
12
 
13
+ state: any = {
14
+ nativeProps: {},
15
+ };
16
+
13
17
  setNativeProps(args: TextProps) {
14
- return this._root && this._root.setNativeProps(args);
18
+ this.state.nativeProps = args || {};
15
19
  }
16
20
 
17
21
  render() {
@@ -21,6 +25,7 @@ class Text extends React.Component<Props> {
21
25
  return (
22
26
  <NativeText
23
27
  {...rest}
28
+ {...this.state.nativeProps}
24
29
  ref={(c) => {
25
30
  this._root = c;
26
31
  }}
@@ -10,6 +10,7 @@ class TextField extends React.Component {
10
10
  constructor() {
11
11
  super(...arguments);
12
12
  this.state = {
13
+ nativeProps: {},
13
14
  labeled: new Animated.Value(this.props.value || this.props.error ? 0 : 1),
14
15
  focused: false,
15
16
  placeholder: this.props.error ? this.props.placeholder : "",
@@ -121,7 +122,10 @@ class TextField extends React.Component {
121
122
  * @internal
122
123
  */
123
124
  setNativeProps(args) {
124
- return this._root && this._root.setNativeProps(args);
125
+ this.setState((state) => ({
126
+ ...state,
127
+ nativeState: args || {},
128
+ }));
125
129
  }
126
130
  isFocused() {
127
131
  return this._root && this._root.isFocused();
@@ -381,6 +385,7 @@ class TextField extends React.Component {
381
385
  underlineColorAndroid: "transparent",
382
386
  style: inputStyles,
383
387
  ...rest,
388
+ ...this.state.nativeProps,
384
389
  value: this.state.value,
385
390
  })),
386
391
  rightIconName ? (React.createElement(Icon, { name: rightIconName, size: ICON_SIZE, color: colors.light, style: {
@@ -52,6 +52,7 @@ export type Props = {
52
52
  IconSlot;
53
53
 
54
54
  interface State {
55
+ nativeProps: any;
55
56
  labeled: Animated.Value;
56
57
  focused?: boolean;
57
58
  placeholder?: string | undefined;
@@ -73,6 +74,7 @@ class TextField extends React.Component<Props, State> {
73
74
  }
74
75
 
75
76
  state: State = {
77
+ nativeProps: {},
76
78
  labeled: new Animated.Value(this.props.value || this.props.error ? 0 : 1),
77
79
  focused: false,
78
80
  placeholder: this.props.error ? this.props.placeholder : "",
@@ -207,7 +209,10 @@ class TextField extends React.Component<Props, State> {
207
209
  * @internal
208
210
  */
209
211
  setNativeProps(args: Props) {
210
- return this._root && this._root.setNativeProps(args);
212
+ this.setState((state) => ({
213
+ ...state,
214
+ nativeState: args || {},
215
+ }));
211
216
  }
212
217
 
213
218
  isFocused() {
@@ -566,6 +571,7 @@ class TextField extends React.Component<Props, State> {
566
571
  underlineColorAndroid: "transparent",
567
572
  style: inputStyles,
568
573
  ...rest,
574
+ ...this.state.nativeProps,
569
575
  value: this.state.value,
570
576
  })}
571
577
  </View>
@@ -1,121 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.SEED_DATA = void 0;
7
-
8
- var _types = require("@draftbit/types");
9
-
10
- const SEED_DATA_TRIGGERS = [_types.Triggers.OnValueChange];
11
- const ELEMENT_PROPS = {
12
- category: _types.COMPONENT_TYPES.element,
13
- stylesPanelSections: _types.BLOCK_STYLES_SECTIONS,
14
- layout: {
15
- margin: 0
16
- },
17
- triggers: SEED_DATA_TRIGGERS
18
- };
19
- const HEADING_PROPS = { ...ELEMENT_PROPS
20
- };
21
- const SEED_DATA = [{
22
- name: "H1",
23
- tag: "H1",
24
- ...HEADING_PROPS
25
- }, {
26
- name: "H2",
27
- tag: "H2",
28
- ...HEADING_PROPS
29
- }, {
30
- name: "H3",
31
- tag: "H3",
32
- ...HEADING_PROPS
33
- }, {
34
- name: "H4",
35
- tag: "H4",
36
- ...HEADING_PROPS
37
- }, {
38
- name: "H5",
39
- tag: "H5",
40
- ...HEADING_PROPS
41
- }, {
42
- name: "H6",
43
- tag: "H6",
44
- ...HEADING_PROPS
45
- }, {
46
- name: "Anchor",
47
- tag: "A",
48
- ...ELEMENT_PROPS,
49
- props: {
50
- href: (0, _types.createTextProp)({
51
- label: "href",
52
- description: "Specify the URL",
53
- defaultValue: ""
54
- }),
55
- target: {
56
- group: _types.GROUPS.basic,
57
- label: "target",
58
- description: "decide where link should open",
59
- formType: _types.FORM_TYPES.flatArray,
60
- defaultValue: "_blank",
61
- options: ["_blank", "_self", "_parent", "_top"]
62
- }
63
- }
64
- }, {
65
- name: "Paragraph",
66
- tag: "P",
67
- ...ELEMENT_PROPS
68
- }, {
69
- name: "Strong",
70
- tag: "Strong",
71
- ...ELEMENT_PROPS
72
- }, {
73
- name: "Strike",
74
- tag: "S",
75
- ...ELEMENT_PROPS
76
- }, {
77
- name: "Italic",
78
- tag: "I",
79
- ...ELEMENT_PROPS
80
- }, {
81
- name: "Code",
82
- tag: "Code",
83
- ...ELEMENT_PROPS
84
- }, {
85
- name: "Pre",
86
- tag: "Pre",
87
- ...ELEMENT_PROPS
88
- }, {
89
- name: "Mark",
90
- tag: "Mark",
91
- ...ELEMENT_PROPS
92
- }, {
93
- name: "BR",
94
- tag: "BR",
95
- ...ELEMENT_PROPS
96
- }, {
97
- name: "Quote",
98
- tag: "Q",
99
- ...ELEMENT_PROPS
100
- }, {
101
- name: "BlockQuote",
102
- tag: "BlockQuote",
103
- ...ELEMENT_PROPS
104
- }, {
105
- name: "Time",
106
- tag: "Time",
107
- ...ELEMENT_PROPS
108
- }, {
109
- name: "UL",
110
- tag: "UL",
111
- ...ELEMENT_PROPS
112
- }, {
113
- name: "LI",
114
- tag: "LI",
115
- ...ELEMENT_PROPS
116
- }, {
117
- name: "HR",
118
- tag: "HR",
119
- ...ELEMENT_PROPS
120
- }];
121
- exports.SEED_DATA = SEED_DATA;
@@ -1,112 +0,0 @@
1
- import { BLOCK_STYLES_SECTIONS, COMPONENT_TYPES, createTextProp, FORM_TYPES, GROUPS, Triggers } from "@draftbit/types";
2
- const SEED_DATA_TRIGGERS = [Triggers.OnValueChange];
3
- const ELEMENT_PROPS = {
4
- category: COMPONENT_TYPES.element,
5
- stylesPanelSections: BLOCK_STYLES_SECTIONS,
6
- layout: {
7
- margin: 0
8
- },
9
- triggers: SEED_DATA_TRIGGERS
10
- };
11
- const HEADING_PROPS = { ...ELEMENT_PROPS
12
- };
13
- export const SEED_DATA = [{
14
- name: "H1",
15
- tag: "H1",
16
- ...HEADING_PROPS
17
- }, {
18
- name: "H2",
19
- tag: "H2",
20
- ...HEADING_PROPS
21
- }, {
22
- name: "H3",
23
- tag: "H3",
24
- ...HEADING_PROPS
25
- }, {
26
- name: "H4",
27
- tag: "H4",
28
- ...HEADING_PROPS
29
- }, {
30
- name: "H5",
31
- tag: "H5",
32
- ...HEADING_PROPS
33
- }, {
34
- name: "H6",
35
- tag: "H6",
36
- ...HEADING_PROPS
37
- }, {
38
- name: "Anchor",
39
- tag: "A",
40
- ...ELEMENT_PROPS,
41
- props: {
42
- href: createTextProp({
43
- label: "href",
44
- description: "Specify the URL",
45
- defaultValue: ""
46
- }),
47
- target: {
48
- group: GROUPS.basic,
49
- label: "target",
50
- description: "decide where link should open",
51
- formType: FORM_TYPES.flatArray,
52
- defaultValue: "_blank",
53
- options: ["_blank", "_self", "_parent", "_top"]
54
- }
55
- }
56
- }, {
57
- name: "Paragraph",
58
- tag: "P",
59
- ...ELEMENT_PROPS
60
- }, {
61
- name: "Strong",
62
- tag: "Strong",
63
- ...ELEMENT_PROPS
64
- }, {
65
- name: "Strike",
66
- tag: "S",
67
- ...ELEMENT_PROPS
68
- }, {
69
- name: "Italic",
70
- tag: "I",
71
- ...ELEMENT_PROPS
72
- }, {
73
- name: "Code",
74
- tag: "Code",
75
- ...ELEMENT_PROPS
76
- }, {
77
- name: "Pre",
78
- tag: "Pre",
79
- ...ELEMENT_PROPS
80
- }, {
81
- name: "Mark",
82
- tag: "Mark",
83
- ...ELEMENT_PROPS
84
- }, {
85
- name: "BR",
86
- tag: "BR",
87
- ...ELEMENT_PROPS
88
- }, {
89
- name: "Quote",
90
- tag: "Q",
91
- ...ELEMENT_PROPS
92
- }, {
93
- name: "BlockQuote",
94
- tag: "BlockQuote",
95
- ...ELEMENT_PROPS
96
- }, {
97
- name: "Time",
98
- tag: "Time",
99
- ...ELEMENT_PROPS
100
- }, {
101
- name: "UL",
102
- tag: "UL",
103
- ...ELEMENT_PROPS
104
- }, {
105
- name: "LI",
106
- tag: "LI",
107
- ...ELEMENT_PROPS
108
- }, {
109
- name: "HR",
110
- tag: "HR",
111
- ...ELEMENT_PROPS
112
- }];
@@ -1,30 +0,0 @@
1
- export declare const SEED_DATA: ({
2
- category: string;
3
- stylesPanelSections: string[];
4
- layout: {
5
- margin: number;
6
- };
7
- triggers: string[];
8
- name: string;
9
- tag: string;
10
- } | {
11
- props: {
12
- href: any;
13
- target: {
14
- group: string;
15
- label: string;
16
- description: string;
17
- formType: string;
18
- defaultValue: string;
19
- options: string[];
20
- };
21
- };
22
- category: string;
23
- stylesPanelSections: string[];
24
- layout: {
25
- margin: number;
26
- };
27
- triggers: string[];
28
- name: string;
29
- tag: string;
30
- })[];
@@ -1,135 +0,0 @@
1
- import { BLOCK_STYLES_SECTIONS, COMPONENT_TYPES, createTextProp, FORM_TYPES, GROUPS, Triggers, } from "@draftbit/types";
2
- const SEED_DATA_TRIGGERS = [Triggers.OnValueChange];
3
- const ELEMENT_PROPS = {
4
- category: COMPONENT_TYPES.element,
5
- stylesPanelSections: BLOCK_STYLES_SECTIONS,
6
- layout: {
7
- margin: 0,
8
- },
9
- triggers: SEED_DATA_TRIGGERS,
10
- };
11
- const HEADING_PROPS = {
12
- ...ELEMENT_PROPS,
13
- };
14
- export const SEED_DATA = [
15
- {
16
- name: "H1",
17
- tag: "H1",
18
- ...HEADING_PROPS,
19
- },
20
- {
21
- name: "H2",
22
- tag: "H2",
23
- ...HEADING_PROPS,
24
- },
25
- {
26
- name: "H3",
27
- tag: "H3",
28
- ...HEADING_PROPS,
29
- },
30
- {
31
- name: "H4",
32
- tag: "H4",
33
- ...HEADING_PROPS,
34
- },
35
- {
36
- name: "H5",
37
- tag: "H5",
38
- ...HEADING_PROPS,
39
- },
40
- {
41
- name: "H6",
42
- tag: "H6",
43
- ...HEADING_PROPS,
44
- },
45
- {
46
- name: "Anchor",
47
- tag: "A",
48
- ...ELEMENT_PROPS,
49
- props: {
50
- href: createTextProp({
51
- label: "href",
52
- description: "Specify the URL",
53
- defaultValue: "",
54
- }),
55
- target: {
56
- group: GROUPS.basic,
57
- label: "target",
58
- description: "decide where link should open",
59
- formType: FORM_TYPES.flatArray,
60
- defaultValue: "_blank",
61
- options: ["_blank", "_self", "_parent", "_top"],
62
- },
63
- },
64
- },
65
- {
66
- name: "Paragraph",
67
- tag: "P",
68
- ...ELEMENT_PROPS,
69
- },
70
- {
71
- name: "Strong",
72
- tag: "Strong",
73
- ...ELEMENT_PROPS,
74
- },
75
- {
76
- name: "Strike",
77
- tag: "S",
78
- ...ELEMENT_PROPS,
79
- },
80
- {
81
- name: "Italic",
82
- tag: "I",
83
- ...ELEMENT_PROPS,
84
- },
85
- {
86
- name: "Code",
87
- tag: "Code",
88
- ...ELEMENT_PROPS,
89
- },
90
- {
91
- name: "Pre",
92
- tag: "Pre",
93
- ...ELEMENT_PROPS,
94
- },
95
- {
96
- name: "Mark",
97
- tag: "Mark",
98
- ...ELEMENT_PROPS,
99
- },
100
- {
101
- name: "BR",
102
- tag: "BR",
103
- ...ELEMENT_PROPS,
104
- },
105
- {
106
- name: "Quote",
107
- tag: "Q",
108
- ...ELEMENT_PROPS,
109
- },
110
- {
111
- name: "BlockQuote",
112
- tag: "BlockQuote",
113
- ...ELEMENT_PROPS,
114
- },
115
- {
116
- name: "Time",
117
- tag: "Time",
118
- ...ELEMENT_PROPS,
119
- },
120
- {
121
- name: "UL",
122
- tag: "UL",
123
- ...ELEMENT_PROPS,
124
- },
125
- {
126
- name: "LI",
127
- tag: "LI",
128
- ...ELEMENT_PROPS,
129
- },
130
- {
131
- name: "HR",
132
- tag: "HR",
133
- ...ELEMENT_PROPS,
134
- },
135
- ];
@@ -1,145 +0,0 @@
1
- import {
2
- BLOCK_STYLES_SECTIONS,
3
- COMPONENT_TYPES,
4
- createTextProp,
5
- FORM_TYPES,
6
- GROUPS,
7
- Triggers,
8
- } from "@draftbit/types";
9
- const SEED_DATA_TRIGGERS = [Triggers.OnValueChange];
10
-
11
- const ELEMENT_PROPS = {
12
- category: COMPONENT_TYPES.element,
13
- stylesPanelSections: BLOCK_STYLES_SECTIONS,
14
- layout: {
15
- margin: 0,
16
- },
17
- triggers: SEED_DATA_TRIGGERS,
18
- };
19
-
20
- const HEADING_PROPS = {
21
- ...ELEMENT_PROPS,
22
- };
23
-
24
- export const SEED_DATA = [
25
- {
26
- name: "H1",
27
- tag: "H1",
28
- ...HEADING_PROPS,
29
- },
30
- {
31
- name: "H2",
32
- tag: "H2",
33
- ...HEADING_PROPS,
34
- },
35
- {
36
- name: "H3",
37
- tag: "H3",
38
- ...HEADING_PROPS,
39
- },
40
- {
41
- name: "H4",
42
- tag: "H4",
43
- ...HEADING_PROPS,
44
- },
45
- {
46
- name: "H5",
47
- tag: "H5",
48
- ...HEADING_PROPS,
49
- },
50
- {
51
- name: "H6",
52
- tag: "H6",
53
- ...HEADING_PROPS,
54
- },
55
- {
56
- name: "Anchor",
57
- tag: "A",
58
- ...ELEMENT_PROPS,
59
- props: {
60
- href: createTextProp({
61
- label: "href",
62
- description: "Specify the URL",
63
- defaultValue: "",
64
- }),
65
- target: {
66
- group: GROUPS.basic,
67
- label: "target",
68
- description: "decide where link should open",
69
- formType: FORM_TYPES.flatArray,
70
- defaultValue: "_blank",
71
- options: ["_blank", "_self", "_parent", "_top"],
72
- },
73
- },
74
- },
75
- {
76
- name: "Paragraph",
77
- tag: "P",
78
- ...ELEMENT_PROPS,
79
- },
80
- {
81
- name: "Strong",
82
- tag: "Strong",
83
- ...ELEMENT_PROPS,
84
- },
85
- {
86
- name: "Strike",
87
- tag: "S",
88
- ...ELEMENT_PROPS,
89
- },
90
- {
91
- name: "Italic",
92
- tag: "I",
93
- ...ELEMENT_PROPS,
94
- },
95
- {
96
- name: "Code",
97
- tag: "Code",
98
- ...ELEMENT_PROPS,
99
- },
100
- {
101
- name: "Pre",
102
- tag: "Pre",
103
- ...ELEMENT_PROPS,
104
- },
105
- {
106
- name: "Mark",
107
- tag: "Mark",
108
- ...ELEMENT_PROPS,
109
- },
110
- {
111
- name: "BR",
112
- tag: "BR",
113
- ...ELEMENT_PROPS,
114
- },
115
- {
116
- name: "Quote",
117
- tag: "Q",
118
- ...ELEMENT_PROPS,
119
- },
120
- {
121
- name: "BlockQuote",
122
- tag: "BlockQuote",
123
- ...ELEMENT_PROPS,
124
- },
125
- {
126
- name: "Time",
127
- tag: "Time",
128
- ...ELEMENT_PROPS,
129
- },
130
- {
131
- name: "UL",
132
- tag: "UL",
133
- ...ELEMENT_PROPS,
134
- },
135
- {
136
- name: "LI",
137
- tag: "LI",
138
- ...ELEMENT_PROPS,
139
- },
140
- {
141
- name: "HR",
142
- tag: "HR",
143
- ...ELEMENT_PROPS,
144
- },
145
- ];