From 356f829dc4d3dd5d82087fef47bb6af5ed217fcf Mon Sep 17 00:00:00 2001 From: juliodialpad Date: Fri, 13 Sep 2024 13:36:07 -0600 Subject: [PATCH 1/6] add dt-combinator package Signed-off-by: Julio Ortega --- .markdownlintignore | 1 + .stylelintignore | 1 + lint-staged.config.cjs | 6 +- packages/combinator/.eslintignore | 5 + packages/combinator/.eslintrc.js | 55 + .../documentation/COMMIT_CONVENTION.md | 85 + .../.github/documentation/CONTRIBUTING.md | 97 + .../.github/documentation/FUTURE_ADDITIONS.md | 83 + .../.github/documentation/KNOWN_ISSUES.md | 16 + .../.github/documentation/OVERVIEW.md | 188 ++ .../.github/documentation/RELEASING.md | 31 + .../combinator/.github/documentation/USAGE.md | 217 ++ .../documentation/internal/CODE_PANEL.md | 65 + .../documentation/internal/CONTROLS.md | 110 + .../documentation/internal/OPTION_BAR.md | 101 + .../documentation/internal/RENDERER.md | 20 + .../.github/documentation/internal/SYSTEM.md | 225 +++ .../.github/pull_request_template.md | 11 + .../.github/workflows/deploy-preview.yml | 57 + .../combinator/.github/workflows/deploy.yml | 40 + .../combinator/.github/workflows/linter.yml | 36 + .../.github/workflows/unit-tests.yml | 37 + packages/combinator/.gitignore | 28 + packages/combinator/LICENSE.md | 21 + packages/combinator/README.md | 44 + packages/combinator/index.js | 3 + packages/combinator/package.json | 55 + packages/combinator/public/index.html | 12 + packages/combinator/release.sh | 4 + packages/combinator/src/App.vue | 150 ++ packages/combinator/src/assets/dialtone.less | 1 + .../combinator/src/assets/themes/base.less | 21 + .../combinator/src/assets/themes/dark.less | 26 + .../combinator/src/assets/themes/light.less | 16 + .../src/assets/themes/scheme/base.less | 5 + .../src/assets/themes/scheme/highlight.less | 8 + .../assets/themes/scheme/highlight_light.less | 8 + .../themes/scheme/highlight_variables.less | 5 + .../src/assets/themes/scheme/mono.less | 7 + .../combinator/src/assets/transitions.less | 17 + packages/combinator/src/base.test.js | 12 + .../components/code_editor/code_editor.vue | 174 ++ .../code_editor/code_editor_closing_tag.vue | 26 + .../code_editor/code_editor_element.vue | 44 + .../code_editor/code_editor_indent.vue | 38 + .../code_editor/code_editor_input.vue | 31 + .../code_editor/code_editor_opening_tag.vue | 30 + .../code_editor/code_editor_slot.vue | 74 + .../code_editor/code_editor_tag.vue | 24 + .../code_editor_tag_attributes.vue | 141 ++ .../src/components/code_panel/code_panel.vue | 127 ++ .../src/components/combinator.test.js | 36 + .../combinator/src/components/combinator.vue | 395 ++++ .../components/controls/control_array.test.js | 63 + .../src/components/controls/control_array.vue | 62 + .../components/controls/control_base.test.js | 18 + .../src/components/controls/control_base.vue | 36 + .../controls/control_boolean.test.js | 56 + .../components/controls/control_boolean.vue | 51 + .../controls/control_dynamic.test.js | 93 + .../components/controls/control_dynamic.vue | 135 ++ .../components/controls/control_event.test.js | 18 + .../src/components/controls/control_event.vue | 14 + .../controls/control_iterable.test.js | 23 + .../components/controls/control_iterable.vue | 136 ++ .../controls/control_nullish.test.js | 58 + .../components/controls/control_nullish.vue | 58 + .../controls/control_number.test.js | 56 + .../components/controls/control_number.vue | 65 + .../controls/control_object.test.js | 81 + .../components/controls/control_object.vue | 124 ++ .../controls/control_selection.test.js | 65 + .../components/controls/control_selection.vue | 57 + .../components/controls/control_slot.test.js | 56 + .../src/components/controls/control_slot.vue | 46 + .../controls/control_string.test.js | 60 + .../components/controls/control_string.vue | 61 + .../controls/control_suggestion.vue | 120 ++ .../event_console/event_console.test.js | 18 + .../event_console/event_console.vue | 78 + .../event_console/event_console_array.vue | 41 + .../event_console/event_console_element.vue | 39 + .../event_console/event_console_function.vue | 12 + .../event_console/event_console_lazy_load.vue | 60 + .../event_console/event_console_object.vue | 53 + .../event_console/event_console_pair.vue | 70 + .../event_console/event_console_string.vue | 24 + .../event_console/event_console_value.vue | 34 + .../src/components/header/header.vue | 84 + .../src/components/option_bar/option_bar.vue | 170 ++ .../option_bar/option_bar_control.test.js | 47 + .../option_bar/option_bar_control.vue | 187 ++ .../option_bar_control_selector.vue | 130 ++ .../option_bar_member_group.test.js | 59 + .../option_bar/option_bar_member_group.vue | 222 +++ .../src/components/renderer/renderer.vue | 151 ++ .../renderer/renderer_button_bar.vue | 43 + .../src/components/renderer/renderer_menu.vue | 111 ++ .../components/renderer/renderer_target.vue | 120 ++ .../settings_menu/settings_menu.vue | 134 ++ .../src/components/tools/button_bar.vue | 43 + .../combinator/src/components/tools/node.vue | 23 + .../src/components/tools/overlay.vue | 16 + .../src/components/tools/section.vue | 62 + .../src/components/tools/tab_panel.vue | 83 + packages/combinator/src/lib/constants.js | 18 + packages/combinator/src/lib/control.js | 132 ++ packages/combinator/src/lib/convert.js | 85 + packages/combinator/src/lib/info.js | 175 ++ packages/combinator/src/lib/info_extend.js | 73 + packages/combinator/src/lib/ordered_object.js | 80 + packages/combinator/src/lib/parse.js | 21 + .../combinator/src/lib/test/utils_test.js | 15 + packages/combinator/src/lib/utils.js | 117 ++ packages/combinator/src/lib/utils_vue.js | 86 + packages/combinator/src/main.js | 4 + packages/combinator/src/settings.json | 15 + .../combinator/src/supported_components.json | 21 + packages/combinator/src/variants/variants.js | 29 + .../combinator/src/variants/variants_badge.js | 9 + .../src/variants/variants_breadcrumbs.js | 15 + .../src/variants/variants_button.js | 113 ++ .../src/variants/variants_checkbox.js | 9 + .../combinator/src/variants/variants_chip.js | 9 + .../combinator/src/variants/variants_input.js | 14 + .../combinator/src/variants/variants_link.js | 14 + .../src/variants/variants_notice.js | 19 + .../combinator/src/variants/variants_radio.js | 9 + .../src/variants/variants_select_menu.js | 21 + .../combinator/src/variants/variants_toast.js | 22 + .../src/variants/variants_toggle.js | 9 + packages/combinator/vue.config.js | 18 + pnpm-lock.yaml | 1771 +++++++++++++++-- 133 files changed, 9566 insertions(+), 153 deletions(-) create mode 100644 packages/combinator/.eslintignore create mode 100644 packages/combinator/.eslintrc.js create mode 100644 packages/combinator/.github/documentation/COMMIT_CONVENTION.md create mode 100644 packages/combinator/.github/documentation/CONTRIBUTING.md create mode 100644 packages/combinator/.github/documentation/FUTURE_ADDITIONS.md create mode 100644 packages/combinator/.github/documentation/KNOWN_ISSUES.md create mode 100644 packages/combinator/.github/documentation/OVERVIEW.md create mode 100644 packages/combinator/.github/documentation/RELEASING.md create mode 100644 packages/combinator/.github/documentation/USAGE.md create mode 100644 packages/combinator/.github/documentation/internal/CODE_PANEL.md create mode 100644 packages/combinator/.github/documentation/internal/CONTROLS.md create mode 100644 packages/combinator/.github/documentation/internal/OPTION_BAR.md create mode 100644 packages/combinator/.github/documentation/internal/RENDERER.md create mode 100644 packages/combinator/.github/documentation/internal/SYSTEM.md create mode 100644 packages/combinator/.github/pull_request_template.md create mode 100644 packages/combinator/.github/workflows/deploy-preview.yml create mode 100644 packages/combinator/.github/workflows/deploy.yml create mode 100644 packages/combinator/.github/workflows/linter.yml create mode 100644 packages/combinator/.github/workflows/unit-tests.yml create mode 100644 packages/combinator/.gitignore create mode 100644 packages/combinator/LICENSE.md create mode 100644 packages/combinator/README.md create mode 100644 packages/combinator/index.js create mode 100644 packages/combinator/package.json create mode 100644 packages/combinator/public/index.html create mode 100755 packages/combinator/release.sh create mode 100644 packages/combinator/src/App.vue create mode 100644 packages/combinator/src/assets/dialtone.less create mode 100644 packages/combinator/src/assets/themes/base.less create mode 100644 packages/combinator/src/assets/themes/dark.less create mode 100644 packages/combinator/src/assets/themes/light.less create mode 100644 packages/combinator/src/assets/themes/scheme/base.less create mode 100644 packages/combinator/src/assets/themes/scheme/highlight.less create mode 100644 packages/combinator/src/assets/themes/scheme/highlight_light.less create mode 100644 packages/combinator/src/assets/themes/scheme/highlight_variables.less create mode 100644 packages/combinator/src/assets/themes/scheme/mono.less create mode 100644 packages/combinator/src/assets/transitions.less create mode 100644 packages/combinator/src/base.test.js create mode 100644 packages/combinator/src/components/code_editor/code_editor.vue create mode 100644 packages/combinator/src/components/code_editor/code_editor_closing_tag.vue create mode 100644 packages/combinator/src/components/code_editor/code_editor_element.vue create mode 100644 packages/combinator/src/components/code_editor/code_editor_indent.vue create mode 100644 packages/combinator/src/components/code_editor/code_editor_input.vue create mode 100644 packages/combinator/src/components/code_editor/code_editor_opening_tag.vue create mode 100644 packages/combinator/src/components/code_editor/code_editor_slot.vue create mode 100644 packages/combinator/src/components/code_editor/code_editor_tag.vue create mode 100644 packages/combinator/src/components/code_editor/code_editor_tag_attributes.vue create mode 100644 packages/combinator/src/components/code_panel/code_panel.vue create mode 100644 packages/combinator/src/components/combinator.test.js create mode 100644 packages/combinator/src/components/combinator.vue create mode 100644 packages/combinator/src/components/controls/control_array.test.js create mode 100644 packages/combinator/src/components/controls/control_array.vue create mode 100644 packages/combinator/src/components/controls/control_base.test.js create mode 100644 packages/combinator/src/components/controls/control_base.vue create mode 100644 packages/combinator/src/components/controls/control_boolean.test.js create mode 100644 packages/combinator/src/components/controls/control_boolean.vue create mode 100644 packages/combinator/src/components/controls/control_dynamic.test.js create mode 100644 packages/combinator/src/components/controls/control_dynamic.vue create mode 100644 packages/combinator/src/components/controls/control_event.test.js create mode 100644 packages/combinator/src/components/controls/control_event.vue create mode 100644 packages/combinator/src/components/controls/control_iterable.test.js create mode 100644 packages/combinator/src/components/controls/control_iterable.vue create mode 100644 packages/combinator/src/components/controls/control_nullish.test.js create mode 100644 packages/combinator/src/components/controls/control_nullish.vue create mode 100644 packages/combinator/src/components/controls/control_number.test.js create mode 100644 packages/combinator/src/components/controls/control_number.vue create mode 100644 packages/combinator/src/components/controls/control_object.test.js create mode 100644 packages/combinator/src/components/controls/control_object.vue create mode 100644 packages/combinator/src/components/controls/control_selection.test.js create mode 100644 packages/combinator/src/components/controls/control_selection.vue create mode 100644 packages/combinator/src/components/controls/control_slot.test.js create mode 100644 packages/combinator/src/components/controls/control_slot.vue create mode 100644 packages/combinator/src/components/controls/control_string.test.js create mode 100644 packages/combinator/src/components/controls/control_string.vue create mode 100644 packages/combinator/src/components/controls/control_suggestion.vue create mode 100644 packages/combinator/src/components/event_console/event_console.test.js create mode 100644 packages/combinator/src/components/event_console/event_console.vue create mode 100644 packages/combinator/src/components/event_console/event_console_array.vue create mode 100644 packages/combinator/src/components/event_console/event_console_element.vue create mode 100644 packages/combinator/src/components/event_console/event_console_function.vue create mode 100644 packages/combinator/src/components/event_console/event_console_lazy_load.vue create mode 100644 packages/combinator/src/components/event_console/event_console_object.vue create mode 100644 packages/combinator/src/components/event_console/event_console_pair.vue create mode 100644 packages/combinator/src/components/event_console/event_console_string.vue create mode 100644 packages/combinator/src/components/event_console/event_console_value.vue create mode 100644 packages/combinator/src/components/header/header.vue create mode 100644 packages/combinator/src/components/option_bar/option_bar.vue create mode 100644 packages/combinator/src/components/option_bar/option_bar_control.test.js create mode 100644 packages/combinator/src/components/option_bar/option_bar_control.vue create mode 100644 packages/combinator/src/components/option_bar/option_bar_control_selector.vue create mode 100644 packages/combinator/src/components/option_bar/option_bar_member_group.test.js create mode 100644 packages/combinator/src/components/option_bar/option_bar_member_group.vue create mode 100644 packages/combinator/src/components/renderer/renderer.vue create mode 100644 packages/combinator/src/components/renderer/renderer_button_bar.vue create mode 100644 packages/combinator/src/components/renderer/renderer_menu.vue create mode 100644 packages/combinator/src/components/renderer/renderer_target.vue create mode 100644 packages/combinator/src/components/settings_menu/settings_menu.vue create mode 100644 packages/combinator/src/components/tools/button_bar.vue create mode 100644 packages/combinator/src/components/tools/node.vue create mode 100644 packages/combinator/src/components/tools/overlay.vue create mode 100644 packages/combinator/src/components/tools/section.vue create mode 100644 packages/combinator/src/components/tools/tab_panel.vue create mode 100644 packages/combinator/src/lib/constants.js create mode 100644 packages/combinator/src/lib/control.js create mode 100644 packages/combinator/src/lib/convert.js create mode 100644 packages/combinator/src/lib/info.js create mode 100644 packages/combinator/src/lib/info_extend.js create mode 100644 packages/combinator/src/lib/ordered_object.js create mode 100644 packages/combinator/src/lib/parse.js create mode 100644 packages/combinator/src/lib/test/utils_test.js create mode 100644 packages/combinator/src/lib/utils.js create mode 100644 packages/combinator/src/lib/utils_vue.js create mode 100644 packages/combinator/src/main.js create mode 100644 packages/combinator/src/settings.json create mode 100644 packages/combinator/src/supported_components.json create mode 100644 packages/combinator/src/variants/variants.js create mode 100644 packages/combinator/src/variants/variants_badge.js create mode 100644 packages/combinator/src/variants/variants_breadcrumbs.js create mode 100644 packages/combinator/src/variants/variants_button.js create mode 100644 packages/combinator/src/variants/variants_checkbox.js create mode 100644 packages/combinator/src/variants/variants_chip.js create mode 100644 packages/combinator/src/variants/variants_input.js create mode 100644 packages/combinator/src/variants/variants_link.js create mode 100644 packages/combinator/src/variants/variants_notice.js create mode 100644 packages/combinator/src/variants/variants_radio.js create mode 100644 packages/combinator/src/variants/variants_select_menu.js create mode 100644 packages/combinator/src/variants/variants_toast.js create mode 100644 packages/combinator/src/variants/variants_toggle.js create mode 100644 packages/combinator/vue.config.js diff --git a/.markdownlintignore b/.markdownlintignore index cab567185e..fa4e786ec4 100644 --- a/.markdownlintignore +++ b/.markdownlintignore @@ -1,3 +1,4 @@ CHANGELOG.md node_modules dist +packages/combinator \ No newline at end of file diff --git a/.stylelintignore b/.stylelintignore index b94cd2c9ca..61f4d380fe 100644 --- a/.stylelintignore +++ b/.stylelintignore @@ -1,2 +1,3 @@ packages/dialtone-css/lib/build/less/utilities packages/dialtone-css/lib/build/less/dialtone-reset.less +packages/combinator diff --git a/lint-staged.config.cjs b/lint-staged.config.cjs index 11755a5a22..6ded8d1c4b 100644 --- a/lint-staged.config.cjs +++ b/lint-staged.config.cjs @@ -3,9 +3,9 @@ module.exports = { 'pnpm exec eslint --fix', ], '*.less': [ - 'pnpm exec stylelint --fix' + 'pnpm exec stylelint --fix --allow-empty-input', ], '*.{md, mdx}': [ - 'pnpm exec markdownlint' - ] + 'pnpm exec markdownlint', + ], }; diff --git a/packages/combinator/.eslintignore b/packages/combinator/.eslintignore new file mode 100644 index 0000000000..60ba8fe74c --- /dev/null +++ b/packages/combinator/.eslintignore @@ -0,0 +1,5 @@ +# build +dist + +# dependencies +node_modules diff --git a/packages/combinator/.eslintrc.js b/packages/combinator/.eslintrc.js new file mode 100644 index 0000000000..8b2a5d97c6 --- /dev/null +++ b/packages/combinator/.eslintrc.js @@ -0,0 +1,55 @@ +module.exports = { + extends: [ + 'standard', + 'semistandard', + 'plugin:jsdoc/recommended', + 'plugin:vue/vue3-recommended', + 'plugin:vuejs-accessibility/recommended', + ], + env: { + browser: true, + node: true, + amd: true, + }, + rules: { + 'max-len': ['error', { + code: 120, + tabWidth: 2, + }], + quotes: ['error', 'single', { allowTemplateLiterals: true }], + 'comma-dangle': ['error', 'always-multiline'], + 'import/no-named-default': 0, + 'vue/comma-dangle': ['error', 'always-multiline'], + 'vue/comma-spacing': ['error', { before: false, after: true }], + 'vue/comma-style': ['error', 'last'], + 'vue/no-v-for-template-key': 0, + 'vue/no-v-html': 0, + 'vue/no-v-model-argument': 0, + 'jsdoc/require-jsdoc': 0, + 'jsdoc/no-undefined-types': 0, + 'jsdoc/require-hyphen-before-param-description': 1, + }, + overrides: [ + { + files: ['**/*.test.js', 'src/lib/test/*.js'], + plugins: [ + 'mocha', + ], + extends: [ + 'plugin:mocha/recommended', + ], + env: { + browser: true, + node: true, + mocha: true, + }, + rules: { + 'max-lines': 'off', + 'mocha/no-setup-in-describe': 'off', + 'mocha/no-exclusive-tests': 'error', + 'mocha/no-hooks-for-single-case': 'off', + 'mocha/no-exports': 0, + }, + }, + ], +}; diff --git a/packages/combinator/.github/documentation/COMMIT_CONVENTION.md b/packages/combinator/.github/documentation/COMMIT_CONVENTION.md new file mode 100644 index 0000000000..d3a1267dd0 --- /dev/null +++ b/packages/combinator/.github/documentation/COMMIT_CONVENTION.md @@ -0,0 +1,85 @@ +## Git Commit Message Convention + +Dialtone Combinator uses +[Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) +for the commit messages in the release branches: `staging`. + +When opening a PR, ensure the PR's title also complies with the Conventional Commits specification. +This way, if your PR is merged using squash strategy, the PR's title will be used as the commit message +except when your PR contains a single commit, in this case Github will use this commit for the commit message when your +PR is merged, so in this case to meet the convention on the single commit of your PR is required. + +Consult +[the rules](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional#rules) +that are considered problems in the commit message. + +Each commit message consists of a **header**, a **body**, and a **footer**. + +```txt +
+ + + +