@flozy/editor 1.6.5 → 1.6.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. package/dist/Editor/CommonEditor.js +55 -100
  2. package/dist/Editor/DialogWrapper.js +3 -0
  3. package/dist/Editor/Editor.css +3 -7
  4. package/dist/Editor/Elements/AppHeader/AppHeader.js +10 -3
  5. package/dist/Editor/Elements/AppHeader/AppHeaderButton.js +12 -9
  6. package/dist/Editor/Elements/Carousel/Carousel.js +1 -1
  7. package/dist/Editor/Elements/Color Picker/ColorButtons.js +29 -13
  8. package/dist/Editor/Elements/Color Picker/Styles.js +4 -4
  9. package/dist/Editor/Elements/Form/Form.js +23 -1
  10. package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +178 -0
  11. package/dist/Editor/Elements/Form/Workflow/ListWorkflow.js +139 -0
  12. package/dist/Editor/Elements/Form/Workflow/MoreOptions.js +64 -0
  13. package/dist/Editor/Elements/Form/Workflow/Styles.js +207 -0
  14. package/dist/Editor/Elements/Form/Workflow/UserInputs.js +207 -0
  15. package/dist/Editor/Elements/Form/Workflow/constant.js +3 -0
  16. package/dist/Editor/Elements/Form/Workflow/index.js +179 -0
  17. package/dist/Editor/Elements/Grid/GridItem.js +8 -6
  18. package/dist/Editor/Elements/InlineIcon/InlineIcon.js +1 -2
  19. package/dist/Editor/Elements/Signature/SignatureOptions/DrawSignature.js +1 -1
  20. package/dist/Editor/Elements/Signature/Signed.js +13 -2
  21. package/dist/Editor/Elements/SimpleText.js +7 -5
  22. package/dist/Editor/Elements/TopBanner/TopBanner.js +2 -2
  23. package/dist/Editor/Elements/TopBanner/TopBannerButton.js +0 -1
  24. package/dist/Editor/Styles/EditorStyles.js +16 -5
  25. package/dist/Editor/Toolbar/Mini/Styles.js +4 -2
  26. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +2 -2
  27. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +4 -14
  28. package/dist/Editor/Toolbar/Toolbar.js +2 -1
  29. package/dist/Editor/Toolbar/toolbarGroups.js +2 -1
  30. package/dist/Editor/common/Icon.js +5 -3
  31. package/dist/Editor/common/ImageSelector/ImageSelector.js +1 -1
  32. package/dist/Editor/common/MentionsPopup/Styles.js +6 -3
  33. package/dist/Editor/common/StyleBuilder/gridItemStyle.js +29 -0
  34. package/dist/Editor/common/iconslist.js +67 -1
  35. package/dist/Editor/hooks/useMentions.js +0 -26
  36. package/dist/Editor/utils/embed.js +14 -10
  37. package/dist/Editor/utils/emoji.js +0 -1
  38. package/dist/Editor/utils/form.js +1 -0
  39. package/dist/Editor/utils/insertAppHeader.js +66 -12
  40. package/package.json +3 -2
@@ -5,10 +5,6 @@ const TYPES = {
5
5
  "@": "mentions",
6
6
  "/": "elements"
7
7
  };
8
- const SHORTHAND_MATCHES = {
9
- mentions: new RegExp(/^@(\w+)$/),
10
- elements: new RegExp(/^\/(\w+)$/)
11
- };
12
8
  const getStartEnd = ({
13
9
  selection,
14
10
  editor
@@ -59,28 +55,6 @@ const getStartEnd = ({
59
55
  };
60
56
  }
61
57
  };
62
- const getRegexCategories = beforeText => {
63
- try {
64
- if (beforeText) {
65
- if (beforeText.match(SHORTHAND_MATCHES.mentions)) {
66
- return {
67
- type: "mentions",
68
- beforeMatch: beforeText.match(SHORTHAND_MATCHES.mentions)
69
- };
70
- } else if (beforeText.match(SHORTHAND_MATCHES.elements)) {
71
- return {
72
- type: "elements",
73
- beforeMatch: beforeText.match(SHORTHAND_MATCHES.elements)
74
- };
75
- }
76
- } else {
77
- return null;
78
- }
79
- } catch (err) {
80
- console.log(err);
81
- return null;
82
- }
83
- };
84
58
  const useMentions = props => {
85
59
  const {
86
60
  editor,
@@ -28,14 +28,18 @@ export const createEmbedNode = (type, {
28
28
  }
29
29
  });
30
30
  export const insertEmbed = (editor, embedData, format) => {
31
- const {
32
- url,
33
- images
34
- } = embedData;
35
- if (!url && images.length === 0) return;
36
- const embed = createEmbedNode(format, embedData);
37
- Transforms.insertNodes(editor, embed, {
38
- at: editor.selection.anchor.path
39
- });
40
- insertNewLine(editor);
31
+ try {
32
+ const {
33
+ url,
34
+ images
35
+ } = embedData;
36
+ if (!url && images.length === 0) return;
37
+ const embed = createEmbedNode(format, embedData);
38
+ Transforms.insertNodes(editor, embed, {
39
+ at: editor.selection.anchor.path
40
+ });
41
+ insertNewLine(editor);
42
+ } catch (err) {
43
+ console.log(err);
44
+ }
41
45
  };
@@ -1,6 +1,5 @@
1
1
  import { Transforms } from "slate";
2
2
  export const insertEmoji = (editor, emoji, position) => {
3
- console.log(editor.selection);
4
3
  Transforms.insertText(editor, emoji, {
5
4
  at: position,
6
5
  select: true
@@ -17,6 +17,7 @@ export const insertForm = (editor, item) => {
17
17
  bottom: 12
18
18
  }
19
19
  },
20
+ workflow: [],
20
21
  children: [{
21
22
  ...formField()
22
23
  }]
@@ -2,19 +2,73 @@ import { Editor, Transforms, Path, Range, Element } from "slate";
2
2
  export const createAppHeaderNode = ({
3
3
  menus
4
4
  }) => ({
5
- type: "app-header",
6
- appTitle: "Title",
7
- appLogo: "https://upload.wikimedia.org/wikipedia/commons/thumb/0/08/Netflix_2015_logo.svg/1200px-Netflix_2015_logo.svg.png",
8
- menus: !menus ? [{
9
- type: "menu",
10
- url: "https://www.google.com",
11
- target: "_blank",
12
- text: "Google"
13
- }] : menus,
14
- menuStyle: "stacked",
5
+ type: "grid",
6
+ grid: "container",
15
7
  children: [{
16
- text: ""
17
- }]
8
+ type: "grid-item",
9
+ grid: 12,
10
+ children: [{
11
+ type: "app-header",
12
+ appTitle: "Logo",
13
+ appLogo: "none",
14
+ menus: menus || [{
15
+ type: "menu",
16
+ url: "/",
17
+ target: "_blank",
18
+ text: "Home"
19
+ }, {
20
+ type: "menu",
21
+ url: "/wireframe2",
22
+ target: "_blank",
23
+ text: "Wireframe"
24
+ }, {
25
+ type: "menu",
26
+ url: "https://www.google.com",
27
+ target: "_blank",
28
+ text: "Work"
29
+ }, {
30
+ type: "menu",
31
+ url: "https://www.google.com",
32
+ target: "_blank",
33
+ text: "Contact"
34
+ }],
35
+ menuStyle: "stacked",
36
+ children: [{
37
+ text: " "
38
+ }],
39
+ logoFontSize: "32px",
40
+ titleFontFamily: "PoppinsBold",
41
+ bgColor: "rgb(255, 255, 255, 0)",
42
+ borderColor: "rgba(255, 255, 255, 0)",
43
+ textColor: "rgb(0, 0, 0)",
44
+ cellBgColor: "#FFFFFF"
45
+ }],
46
+ bgColor: "rgba(255, 255, 255, 0)",
47
+ lockSpacing: true,
48
+ bannerSpacing: {
49
+ top: "8",
50
+ left: "8",
51
+ right: "8",
52
+ bottom: "8"
53
+ },
54
+ alignment: {
55
+ horizantal: "center"
56
+ }
57
+ }],
58
+ alignment: {
59
+ flexDirection: "column"
60
+ },
61
+ lockSpacing: true,
62
+ bannerSpacing: {
63
+ top: "8",
64
+ left: "8",
65
+ right: "8",
66
+ bottom: "8"
67
+ },
68
+ size: {
69
+ widthInPercent: 100
70
+ },
71
+ bgColor: "rgba(255, 255, 255, 1)"
18
72
  });
19
73
  export const insertAppHeader = (editor, props) => {
20
74
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "1.6.5",
3
+ "version": "1.6.7",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"
@@ -22,6 +22,7 @@
22
22
  "@testing-library/jest-dom": "^5.16.5",
23
23
  "@testing-library/react": "^13.4.0",
24
24
  "@testing-library/user-event": "^13.5.0",
25
+ "animate.css": "^4.1.1",
25
26
  "emoji-mart": "^5.5.2",
26
27
  "html2canvas": "^1.4.1",
27
28
  "husky": "^8.0.3",
@@ -59,7 +60,7 @@
59
60
  "storybook": "storybook dev -p 6006",
60
61
  "build-storybook": "storybook build",
61
62
  "publish:npm": "rm -rf dist && mkdir dist && babel src/components -d dist --copy-files",
62
- "publish:local": "rm -rf dist && mkdir dist && babel src/components -d dist --copy-files && rm -rf /Users/dineshkumar/Desktop/devop/sweetpsocial-2.0/client/node_modules/@flozy/editor/dist && babel dist -d /Users/dineshkumar/Desktop/devop/sweetpsocial-2.0/client/node_modules/@flozy/editor/dist --copy-files"
63
+ "publish:local": "rm -rf /Users/agmac03/flozy/client/node_modules/@flozy/editor/dist && babel src/components -d /Users/agmac03/flozy/client/node_modules/@flozy/editor/dist --copy-files"
63
64
  },
64
65
  "eslintConfig": {
65
66
  "extends": [