@nyaruka/temba-components 0.141.1 → 0.142.1
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.
- package/CHANGELOG.md +22 -0
- package/dist/static/svg/index.svg +1 -1
- package/dist/temba-components.js +849 -655
- package/dist/temba-components.js.map +1 -1
- package/out-tsc/src/Icons.js +3 -1
- package/out-tsc/src/Icons.js.map +1 -1
- package/out-tsc/src/display/Button.js +2 -2
- package/out-tsc/src/display/Button.js.map +1 -1
- package/out-tsc/src/display/FloatingTab.js.map +1 -1
- package/out-tsc/src/flow/CanvasMenu.js +24 -1
- package/out-tsc/src/flow/CanvasMenu.js.map +1 -1
- package/out-tsc/src/flow/CanvasNode.js +7 -2
- package/out-tsc/src/flow/CanvasNode.js.map +1 -1
- package/out-tsc/src/flow/Editor.js +654 -66
- package/out-tsc/src/flow/Editor.js.map +1 -1
- package/out-tsc/src/flow/NodeEditor.js +8 -5
- package/out-tsc/src/flow/NodeEditor.js.map +1 -1
- package/out-tsc/src/flow/Plumber.js +40 -28
- package/out-tsc/src/flow/Plumber.js.map +1 -1
- package/out-tsc/src/flow/actions/send_msg.js +2 -1
- package/out-tsc/src/flow/actions/send_msg.js.map +1 -1
- package/out-tsc/src/flow/nodes/wait_for_response.js +1 -1
- package/out-tsc/src/flow/nodes/wait_for_response.js.map +1 -1
- package/out-tsc/src/flow/reflow.js +393 -0
- package/out-tsc/src/flow/reflow.js.map +1 -0
- package/out-tsc/src/flow/types.js.map +1 -1
- package/out-tsc/src/flow/utils.js +18 -3
- package/out-tsc/src/flow/utils.js.map +1 -1
- package/out-tsc/src/form/Compose.js +5 -0
- package/out-tsc/src/form/Compose.js.map +1 -1
- package/out-tsc/src/form/FieldRenderer.js +1 -3
- package/out-tsc/src/form/FieldRenderer.js.map +1 -1
- package/out-tsc/src/layout/Dialog.js +2 -0
- package/out-tsc/src/layout/Dialog.js.map +1 -1
- package/out-tsc/src/list/SortableList.js +39 -19
- package/out-tsc/src/list/SortableList.js.map +1 -1
- package/out-tsc/src/utils.js +5 -12
- package/out-tsc/src/utils.js.map +1 -1
- package/out-tsc/test/nodes/split_by_run_result.test.js +1 -2
- package/out-tsc/test/nodes/split_by_run_result.test.js.map +1 -1
- package/out-tsc/test/temba-canvas-menu.test.js +44 -0
- package/out-tsc/test/temba-canvas-menu.test.js.map +1 -1
- package/out-tsc/test/temba-flow-collision.test.js +25 -0
- package/out-tsc/test/temba-flow-collision.test.js.map +1 -1
- package/out-tsc/test/temba-flow-editor-zoom.test.js +491 -0
- package/out-tsc/test/temba-flow-editor-zoom.test.js.map +1 -0
- package/out-tsc/test/temba-flow-editor.test.js +145 -1
- package/out-tsc/test/temba-flow-editor.test.js.map +1 -1
- package/out-tsc/test/temba-flow-node-drag.test.js +123 -0
- package/out-tsc/test/temba-flow-node-drag.test.js.map +1 -1
- package/out-tsc/test/temba-flow-plumber.test.js +31 -0
- package/out-tsc/test/temba-flow-plumber.test.js.map +1 -1
- package/out-tsc/test/temba-flow-reflow.test.js +472 -0
- package/out-tsc/test/temba-flow-reflow.test.js.map +1 -0
- package/out-tsc/test/temba-sortable-list.test.js +93 -0
- package/out-tsc/test/temba-sortable-list.test.js.map +1 -1
- package/package.json +2 -2
- package/screenshots/truth/actions/add_contact_groups/editor/descriptive-group-names.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/editor/long-group-names.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/editor/many-groups.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/editor/expression-facebook.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/editor/expression-phone.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/editor/facebook-id.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/editor/instagram-handle.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/editor/line-id.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/editor/phone-number.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/editor/telegram-id.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/editor/viber-id.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/editor/wechat-id.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/editor/whatsapp.png +0 -0
- package/screenshots/truth/actions/enter_flow/editor/basic-flow.png +0 -0
- package/screenshots/truth/actions/enter_flow/editor/long-flow-name.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/editor/long-descriptive-group-names.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/editor/many-groups.png +0 -0
- package/screenshots/truth/actions/say_msg/editor/multiline-text.png +0 -0
- package/screenshots/truth/actions/say_msg/editor/simple-text.png +0 -0
- package/screenshots/truth/actions/say_msg/editor/text-with-audio-url.png +0 -0
- package/screenshots/truth/actions/send_broadcast/editor/contacts-only.png +0 -0
- package/screenshots/truth/actions/send_broadcast/editor/groups-and-contacts.png +0 -0
- package/screenshots/truth/actions/send_broadcast/editor/groups-only.png +0 -0
- package/screenshots/truth/actions/send_broadcast/editor/many-groups.png +0 -0
- package/screenshots/truth/actions/send_broadcast/editor/multiline-text.png +0 -0
- package/screenshots/truth/actions/send_email/editor/empty-body.png +0 -0
- package/screenshots/truth/actions/send_email/editor/empty-subject.png +0 -0
- package/screenshots/truth/actions/send_email/editor/long-subject.png +0 -0
- package/screenshots/truth/actions/send_email/editor/multiline-body.png +0 -0
- package/screenshots/truth/actions/send_email/editor/multiple-recipients.png +0 -0
- package/screenshots/truth/actions/send_email/editor/simple-email.png +0 -0
- package/screenshots/truth/actions/send_email/editor/with-expressions.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/long-quick-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/multiline-text-with-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/simple-text.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/text-with-linebreaks.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/text-with-many-quick-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/text-with-quick-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/text-without-quick-replies.png +0 -0
- package/screenshots/truth/actions/set_contact_channel/editor/sms-channel.png +0 -0
- package/screenshots/truth/actions/set_contact_channel/editor/whatsapp-channel.png +0 -0
- package/screenshots/truth/actions/set_contact_field/editor/clear-value.png +0 -0
- package/screenshots/truth/actions/set_contact_field/editor/set-value.png +0 -0
- package/screenshots/truth/actions/set_contact_language/editor/english.png +0 -0
- package/screenshots/truth/actions/set_contact_language/editor/french.png +0 -0
- package/screenshots/truth/actions/set_contact_status/editor/active.png +0 -0
- package/screenshots/truth/actions/set_contact_status/editor/archived.png +0 -0
- package/screenshots/truth/actions/set_contact_status/editor/blocked.png +0 -0
- package/screenshots/truth/actions/set_run_result/editor/expression-value.png +0 -0
- package/screenshots/truth/actions/set_run_result/editor/with-category.png +0 -0
- package/screenshots/truth/actions/start_session/editor/contact-query.png +0 -0
- package/screenshots/truth/actions/start_session/editor/contacts-only.png +0 -0
- package/screenshots/truth/actions/start_session/editor/create-contact.png +0 -0
- package/screenshots/truth/actions/start_session/editor/groups-and-contacts.png +0 -0
- package/screenshots/truth/actions/start_session/editor/groups-only.png +0 -0
- package/screenshots/truth/actions/start_session/editor/many-recipients.png +0 -0
- package/screenshots/truth/list/fields-dragging.png +0 -0
- package/screenshots/truth/list/sortable-dragging.png +0 -0
- package/screenshots/truth/modax/simple.png +0 -0
- package/screenshots/truth/nodes/split_by_llm/editor/information-extraction.png +0 -0
- package/screenshots/truth/nodes/split_by_llm/editor/sentiment-analysis.png +0 -0
- package/screenshots/truth/nodes/split_by_llm/editor/summarization.png +0 -0
- package/screenshots/truth/nodes/split_by_llm/editor/translation-task.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/basic-categorization.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/custom-input-and-result-name.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/feedback-categorization.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/many-categories.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/minimal-categories.png +0 -0
- package/screenshots/truth/nodes/split_by_random/editor/ab-test-multiple-variants.png +0 -0
- package/screenshots/truth/nodes/split_by_random/editor/sampling-split.png +0 -0
- package/screenshots/truth/nodes/split_by_random/editor/three-way-split.png +0 -0
- package/screenshots/truth/nodes/split_by_random/editor/two-bucket-split.png +0 -0
- package/screenshots/truth/nodes/wait_for_dial/editor/dial-with-limits.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/editor/basic-digits-wait.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/editor/digits-with-rules.png +0 -0
- package/screenshots/truth/nodes/wait_for_menu/editor/menu-with-digits.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/editor/basic-wait.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/editor/custom-result-name.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/editor/no-timeout.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/editor/short-timeout.png +0 -0
- package/src/Icons.ts +3 -1
- package/src/display/Button.ts +2 -2
- package/src/display/FloatingTab.ts +1 -1
- package/src/flow/CanvasMenu.ts +28 -3
- package/src/flow/CanvasNode.ts +7 -2
- package/src/flow/Editor.ts +755 -75
- package/src/flow/NodeEditor.ts +8 -4
- package/src/flow/Plumber.ts +65 -35
- package/src/flow/actions/send_msg.ts +2 -1
- package/src/flow/nodes/wait_for_response.ts +1 -1
- package/src/flow/reflow.ts +534 -0
- package/src/flow/types.ts +1 -0
- package/src/flow/utils.ts +19 -3
- package/src/form/Compose.ts +5 -0
- package/src/form/FieldRenderer.ts +1 -3
- package/src/layout/Dialog.ts +2 -0
- package/src/list/SortableList.ts +40 -19
- package/src/utils.ts +5 -12
- package/static/svg/index.svg +1 -1
- package/static/svg/work/traced/expand-06.svg +1 -0
- package/static/svg/work/used/expand-06.svg +3 -0
- package/test/nodes/split_by_run_result.test.ts +1 -2
- package/test/temba-canvas-menu.test.ts +55 -0
- package/test/temba-flow-collision.test.ts +31 -0
- package/test/temba-flow-editor-zoom.test.ts +583 -0
- package/test/temba-flow-editor.test.ts +187 -1
- package/test/temba-flow-node-drag.test.ts +171 -0
- package/test/temba-flow-plumber.test.ts +38 -0
- package/test/temba-flow-reflow.test.ts +703 -0
- package/test/temba-sortable-list.test.ts +120 -0
- package/screenshots/truth/actions/call_llm/editor/information-extraction.png +0 -0
- package/screenshots/truth/actions/call_llm/editor/sentiment-analysis.png +0 -0
- package/screenshots/truth/actions/call_llm/editor/summarization.png +0 -0
- package/screenshots/truth/actions/call_llm/editor/translation-task.png +0 -0
- package/screenshots/truth/actions/call_llm/render/information-extraction.png +0 -0
- package/screenshots/truth/actions/call_llm/render/sentiment-analysis.png +0 -0
- package/screenshots/truth/actions/call_llm/render/summarization.png +0 -0
- package/screenshots/truth/actions/call_llm/render/translation-task.png +0 -0
- package/screenshots/truth/actions/send_broadcast/editor/with-attachments.png +0 -0
- package/screenshots/truth/actions/send_broadcast/render/with-attachments.png +0 -0
- package/screenshots/truth/compose/attachments-with-failures.png +0 -0
- package/screenshots/truth/compose/attachments-with-files-and-failures.png +0 -0
- package/screenshots/truth/contacts/tickets-assignment.png +0 -0
- package/screenshots/truth/contacts/tickets.png +0 -0
- package/screenshots/truth/flow/editor-basic.png +0 -0
- package/screenshots/truth/formfield/markdown-errors.png +0 -0
- package/screenshots/truth/formfield/no-errors.png +0 -0
- package/screenshots/truth/formfield/plain-text-errors.png +0 -0
- package/screenshots/truth/formfield/widget-only-markdown-errors.png +0 -0
- package/screenshots/truth/omnibox/selected.png +0 -0
- package/screenshots/truth/select/enabled-multi-selection.png +0 -0
- package/screenshots/truth/select/endpoint-initial-value-updated.png +0 -0
- package/screenshots/truth/select/endpoint-initial-value.png +0 -0
- package/screenshots/truth/select/initial-value.png +0 -0
- package/screenshots/truth/select/multi-reorder-final.png +0 -0
- package/screenshots/truth/select/multi-reorder-initial.png +0 -0
- package/screenshots/truth/select/selected-multi-test.png +0 -0
- package/screenshots/truth/select/value-initial.png +0 -0
- package/screenshots/truth/wait-for-response/rules-editor.png +0 -0
- package/screenshots/truth/wait-for-response/timeout-editor-unchecked.png +0 -0
- package/screenshots/truth/wait-for-response/timeout-editor.png +0 -0
- package/screenshots/truth/webchat/connecting-state.png +0 -0
package/out-tsc/src/Icons.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-duplicate-enum-values */
|
|
2
2
|
// for cache busting we dynamically generate a fingerprint, use yarn svg to update
|
|
3
|
-
export const SVG_FINGERPRINT = '
|
|
3
|
+
export const SVG_FINGERPRINT = 'de580a861152b5d164592ae63b65e5aa';
|
|
4
4
|
// only icons below are included in the sprite sheet
|
|
5
5
|
export var Icon;
|
|
6
6
|
(function (Icon) {
|
|
@@ -198,6 +198,8 @@ export var Icon;
|
|
|
198
198
|
Icon["video"] = "video-recorder";
|
|
199
199
|
Icon["webhook"] = "link-external-01";
|
|
200
200
|
Icon["workspace"] = "folder";
|
|
201
|
+
Icon["zoom_fit"] = "maximize-02";
|
|
202
|
+
Icon["zoom_in"] = "expand-06";
|
|
201
203
|
// channel types
|
|
202
204
|
Icon["channel_a"] = "channel-android";
|
|
203
205
|
Icon["channel_ac"] = "zap";
|
package/out-tsc/src/Icons.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icons.js","sourceRoot":"","sources":["../../src/Icons.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,kFAAkF;AAClF,MAAM,CAAC,MAAM,eAAe,GAAG,kCAAkC,CAAC;AAElE,oDAAoD;AACpD,MAAM,CAAN,IAAY,IAyQX;AAzQD,WAAY,IAAI;IACd,wBAAgB,CAAA;IAChB,sCAA8B,CAAA;IAC9B,2BAAmB,CAAA;IACnB,+BAAuB,CAAA;IACvB,uBAAe,CAAA;IACf,oBAAY,CAAA;IACZ,4BAAoB,CAAA;IACpB,gCAAwB,CAAA;IACxB,kCAA0B,CAAA;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CAAwB,CAAA;IAExB,cAAc;IACd,yCAAiC,CAAA;IAEjC,eAAe;IACf,uBAAe,CAAA;IACf,yBAAiB,CAAA;IAEjB,OAAO;IACP,wBAAgB,CAAA;IAChB,+BAAuB,CAAA;IACvB,6BAAqB,CAAA;IACrB,0BAAkB,CAAA;IAClB,yBAAiB,CAAA;AACnB,CAAC,EAzQW,IAAI,KAAJ,IAAI,QAyQf","sourcesContent":["/* eslint-disable @typescript-eslint/no-duplicate-enum-values */\n// for cache busting we dynamically generate a fingerprint, use yarn svg to update\nexport const SVG_FINGERPRINT = '129c04a9f99f9f4e99c436a68bc95470';\n\n// only icons below are included in the sprite sheet\nexport enum Icon {\n ai = 'beaker-02',\n alert_warning = 'alert-square',\n account = 'user-01',\n action = 'lightning-02',\n active = 'play',\n add = 'plus',\n add_note = 'file-02',\n airtime = 'bank-note-01',\n analytics = 'bar-chart-01',\n archive = 'archive',\n arrow_up = 'chevron-up',\n arrow_down = 'chevron-down',\n arrow_left = 'chevron-left',\n arrow_right = 'chevron-right',\n attachment = 'paperclip',\n attachment_audio = 'volume-min',\n attachment_document = 'file-06',\n attachment_image = 'image-01',\n attachment_location = 'marker-pin-01',\n attachment_video = 'video-recorder',\n branding = 'brush-02',\n branding_hostname = 'server-05',\n branding_notifications = 'mail-01',\n branding_styling = 'palette',\n branding_raw = 'pencil-01',\n broadcast = 'announcement-01',\n call = 'phone-call-01',\n call_missed = 'phone-call-02',\n campaign = 'clock-refresh',\n campaign_active = 'play',\n campaign_archived = 'archive',\n campaigns = 'clock-refresh',\n channel = 'zap',\n children = 'git-branch-01',\n check = 'check',\n checkbox = 'square',\n checkbox_checked = 'check-square',\n checkbox_partial = 'stop-square',\n close = 'x',\n compose = 'send-01',\n contact = 'user-01',\n contact_archived = 'archive',\n contact_blocked = 'message-x-square',\n contact_export = 'download-cloud-01',\n contact_import = 'upload-cloud-01',\n contact_stopped = 'slash-octagon',\n contact_updated = 'user-edit',\n contacts = 'user-01',\n copy = 'copy-04',\n dashboard = 'pie-chart-01',\n definitions_export = 'download-cloud-01',\n delete = 'trash-03',\n delete_small = 'x',\n down = 'chevron-down',\n download = 'download-01',\n drag = 'dots-grid',\n edit = 'edit-02',\n email = 'mail-01',\n error = 'alert-circle',\n event = 'zap',\n export = 'download-cloud-01',\n expressions = 'at-sign',\n fields = 'user-edit',\n filter = 'filter-funnel-01',\n flow = 'flow',\n flow_background = 'layers-two-01',\n flow_interrupted = 'x-close',\n flow_ivr = 'phone',\n flow_message = 'message-square-02',\n flow_surveyor = 'tablet-01',\n flow_user = 'hard-drive',\n flows = 'flow',\n follow = 'route',\n global = 'at-sign',\n grid = 'dots-grid',\n group = 'users-01',\n group_exclude = 'users-x',\n group_include = 'users-check',\n group_smart = 'atom-01',\n help = 'help-circle',\n hide = 'eye-off',\n home = 'settings-02',\n image = 'image-01',\n import = 'upload-cloud-01',\n inbox = 'inbox-01',\n incidents = 'alert-square',\n incoming_call = 'phone-incoming-01',\n info = 'user-square',\n integrations = 'layers-three-01',\n invitations = 'user-plus-01',\n issue = 'alert-square',\n label = 'tag-01',\n language = 'translate-01',\n link = 'link-external-01',\n location = 'marker-pin-01',\n log = 'file-02',\n logout = 'log-out-04',\n menu = 'menu-01',\n menu_collapse = 'chevron-left-double',\n message = 'message-square-02',\n message_export = 'download-cloud-01',\n messages = 'message-square-02',\n missing = 'maximize-02',\n missed_call = 'phone-x',\n new = 'plus',\n next_schedule = 'alarm-clock',\n note = 'edit-03',\n notes = 'edit-03',\n notification = 'bell-01',\n number = 'hash-01',\n optin_requested = 'message-notification-circle',\n optin = 'message-check-circle',\n optout = 'message-x-circle',\n org_active = 'credit-card-02',\n org_anonymous = 'glasses-01',\n org_bulk = 'credit-card-plus',\n org_flagged = 'flag-01',\n org_new = 'stars-02',\n org_suspended = 'slash-circle-01',\n org_verified = 'check-verified-02',\n overview = 'pie-chart-01',\n prometheus = 'prometheus',\n progress_spinner = 'refresh-cw-04',\n featured = 'star-01',\n quick_replies = 'dotpoints-01',\n recording = 'microphone-01',\n resend = 'refresh-cw-05',\n reset = 'flip-backward',\n resthooks = 'share-07',\n restore = 'play',\n results_export = 'download-cloud-01',\n retry = 'refresh-cw-05',\n revisions = 'clock-rewind',\n rocketchat = 'rocketchat',\n runs = 'rows-03',\n schedule = 'calendar',\n search = 'search-refraction',\n select_open = 'chevron-down',\n select_clear = 'x',\n send = 'send-03',\n service = 'magic-wand-01',\n service_end = 'log-out-04',\n settings = 'settings-02',\n shortcut = 'zap-fast',\n show = 'eye',\n simulator = 'phone-02',\n split = 'flow',\n sort = 'chevron-selector-vertical',\n sort_down = 'sort-arrow-down',\n sort_up = 'sort-arrow-up',\n staff = 'hard-drive',\n submit = 'check',\n success = 'check',\n template_approved = 'check-circle',\n template_pending = 'hourglass-01',\n template_rejected = 'alert-circle',\n tickets = 'agent',\n tickets_all = 'archive',\n tickets_closed = 'check',\n tickets_mine = 'coffee',\n tickets_mine_done = 'coffee-empty',\n tickets_open = 'inbox-01',\n tickets_export = 'download-cloud-01',\n tickets_unassigned = 'inbox-01',\n topic = 'message-text-circle-02',\n two_factor_enabled = 'shield-02',\n two_factor_disabled = 'shield-01',\n trigger = 'signal-01',\n trigger_active = 'play',\n trigger_archived = 'archive',\n trigger_new = 'plus',\n trigger_keyword = 'message-check-square',\n trigger_catch_all = 'message-question-square',\n trigger_inbound_call = 'phone-incoming-01',\n trigger_missed_call = 'phone-hang-up',\n trigger_schedule = 'calendar',\n trigger_new_conversation = 'message-chat-square',\n trigger_referral = 'user-right-01',\n trigger_closed_ticket = 'agent',\n trigger_opt_in = 'message-check-circle',\n trigger_opt_out = 'message-x-circle',\n triggers = 'signal-01',\n updated = 'edit-02',\n up = 'chevron-up',\n upload = 'upload-cloud-01',\n upload_image = 'camera-01',\n usages = 'link-04',\n user = 'users-01',\n user_beta = 'shield-zap',\n user_token = 'key-01',\n users = 'users-01',\n video = 'video-recorder',\n webhook = 'link-external-01',\n workspace = 'folder',\n\n // channel types\n channel_a = 'channel-android',\n channel_ac = 'zap', // TODO https://www.arabiacell.com/\n channel_at = 'zap', // TODO https://africastalking.com/\n channel_bs = 'zap', // TODO https://burstsms.com/\n channel_bw = 'zap', // TODO https://www.bandwidth.com/\n channel_cs = 'zap', // TODO https://www.clicksend.com/\n channel_ct = 'channel-clickatell',\n channel_d3 = 'channel-whatsapp',\n channel_d3c = 'channel-whatsapp',\n channel_da = 'zap', // TODO https://dartmedia.co.id/\n channel_ds = 'channel-discord',\n channel_ex = 'zap',\n channel_fb = 'channel-facebook',\n channel_fba = 'channel-facebook',\n channel_fc = 'channel-freshchat',\n channel_fcm = 'channel-firebase',\n channel_hm = 'zap', // TODO https://hormuud.com/\n channel_ib = 'zap', // TODO https://www.infobip.com/\n channel_ig = 'channel-instagram',\n channel_jc = 'channel-jiochat',\n channel_kn = 'channel-kannel',\n channel_kwa = 'channel-whatsapp',\n channel_ln = 'channel-line',\n channel_mt = 'channel-mtarget',\n channel_mtn = 'zap', // TODO https://mtn.com/\n channel_nx = 'channel-vonage',\n channel_pl = 'channel-plivo',\n channel_rc = 'channel-rocketchat',\n channel_sl = 'channel-slack',\n channel_sq = 'zap', // TODO https://shaqodoon.org/\n channel_st = 'zap', // TODO https://bulk.startmobile.ua\n channel_sw = 'channel-signalwire',\n channel_t = 'channel-twilio',\n channel_tg = 'channel-telegram',\n channel_tms = 'channel-twilio',\n channel_tq = 'channel-thinq',\n channel_tw = 'zap', // TODO https://www.somleng.org/\n channel_twa = 'channel-whatsapp',\n channel_twc = 'zap', // TODO\n channel_twt = 'channel-twitter',\n channel_vk = 'channel-vk',\n channel_vp = 'channel-viber',\n channel_wa = 'channel-whatsapp',\n channel_wac = 'channel-whatsapp',\n channel_wc = 'channel-wechat',\n channel_yo = 'zap', // TODO https://www.yo.co.ug/\n channel_zvw = 'channel-whatsapp',\n\n // ai\n ai_openai = 'openai',\n ai_anthropic = 'anthropic',\n ai_google = 'gemini',\n ai_microsoft = 'azure',\n ai_deepseek = 'deepseek',\n\n // classifiers\n classifier_wit = 'classifier-wit',\n\n // other brands\n dtone = 'dtone',\n zapier = 'zapier',\n\n // demo\n default = 'list',\n datepicker = 'calendar',\n slider = 'sliders-02',\n select = 'browser',\n input = 'edit-05'\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Icons.js","sourceRoot":"","sources":["../../src/Icons.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,kFAAkF;AAClF,MAAM,CAAC,MAAM,eAAe,GAAG,kCAAkC,CAAC;AAElE,oDAAoD;AACpD,MAAM,CAAN,IAAY,IA2QX;AA3QD,WAAY,IAAI;IACd,wBAAgB,CAAA;IAChB,sCAA8B,CAAA;IAC9B,2BAAmB,CAAA;IACnB,+BAAuB,CAAA;IACvB,uBAAe,CAAA;IACf,oBAAY,CAAA;IACZ,4BAAoB,CAAA;IACpB,gCAAwB,CAAA;IACxB,kCAA0B,CAAA;IAC1B,2BAAmB,CAAA;IACnB,+BAAuB,CAAA;IACvB,mCAA2B,CAAA;IAC3B,mCAA2B,CAAA;IAC3B,qCAA6B,CAAA;IAC7B,gCAAwB,CAAA;IACxB,uCAA+B,CAAA;IAC/B,uCAA+B,CAAA;IAC/B,qCAA6B,CAAA;IAC7B,6CAAqC,CAAA;IACrC,2CAAmC,CAAA;IACnC,6BAAqB,CAAA;IACrB,uCAA+B,CAAA;IAC/B,0CAAkC,CAAA;IAClC,oCAA4B,CAAA;IAC5B,kCAA0B,CAAA;IAC1B,qCAA6B,CAAA;IAC7B,8BAAsB,CAAA;IACtB,qCAA6B,CAAA;IAC7B,kCAA0B,CAAA;IAC1B,gCAAwB,CAAA;IACxB,qCAA6B,CAAA;IAC7B,mCAA2B,CAAA;IAC3B,uBAAe,CAAA;IACf,kCAA0B,CAAA;IAC1B,uBAAe,CAAA;IACf,2BAAmB,CAAA;IACnB,yCAAiC,CAAA;IACjC,wCAAgC,CAAA;IAChC,mBAAW,CAAA;IACX,2BAAmB,CAAA;IACnB,2BAAmB,CAAA;IACnB,oCAA4B,CAAA;IAC5B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BAAmB,CAAA;IACnB,qCAA6B,CAAA;IAC7B,oCAA4B,CAAA;IAC5B,yCAAiC,CAAA;IACjC,oCAA4B,CAAA;IAC5B,0BAAkB,CAAA;IAClB,0BAAkB,CAAA;IAClB,yCAAiC,CAAA;IACjC,oCAA4B,CAAA;IAC5B,uCAA+B,CAAA;IAC/B,sCAA8B,CAAA;IAC9B,oCAA4B,CAAA;IAC5B,0BAAkB,CAAA;IAClB,wCAAgC,CAAA;IAChC,2BAAmB,CAAA;IACnB,uCAA+B,CAAA;IAC/B,iCAAyB,CAAA;IACzB,oCAA4B,CAAA;IAC5B,uCAA+B,CAAA;IAC/B,wCAAgC,CAAA;IAChC,qCAA6B,CAAA;IAC7B,0BAAkB,CAAA;IAClB,wCAAgC,CAAA;IAEhC,KAAK;IACL,4BAAoB,CAAA;IACpB,kCAA0B,CAAA;IAC1B,4BAAoB,CAAA;IACpB,8BAAsB,CAAA;IACtB,gCAAwB,CAAA;IAExB,cAAc;IACd,yCAAiC,CAAA;IAEjC,eAAe;IACf,uBAAe,CAAA;IACf,yBAAiB,CAAA;IAEjB,OAAO;IACP,wBAAgB,CAAA;IAChB,+BAAuB,CAAA;IACvB,6BAAqB,CAAA;IACrB,0BAAkB,CAAA;IAClB,yBAAiB,CAAA;AACnB,CAAC,EA3QW,IAAI,KAAJ,IAAI,QA2Qf","sourcesContent":["/* eslint-disable @typescript-eslint/no-duplicate-enum-values */\n// for cache busting we dynamically generate a fingerprint, use yarn svg to update\nexport const SVG_FINGERPRINT = 'de580a861152b5d164592ae63b65e5aa';\n\n// only icons below are included in the sprite sheet\nexport enum Icon {\n ai = 'beaker-02',\n alert_warning = 'alert-square',\n account = 'user-01',\n action = 'lightning-02',\n active = 'play',\n add = 'plus',\n add_note = 'file-02',\n airtime = 'bank-note-01',\n analytics = 'bar-chart-01',\n archive = 'archive',\n arrow_up = 'chevron-up',\n arrow_down = 'chevron-down',\n arrow_left = 'chevron-left',\n arrow_right = 'chevron-right',\n attachment = 'paperclip',\n attachment_audio = 'volume-min',\n attachment_document = 'file-06',\n attachment_image = 'image-01',\n attachment_location = 'marker-pin-01',\n attachment_video = 'video-recorder',\n branding = 'brush-02',\n branding_hostname = 'server-05',\n branding_notifications = 'mail-01',\n branding_styling = 'palette',\n branding_raw = 'pencil-01',\n broadcast = 'announcement-01',\n call = 'phone-call-01',\n call_missed = 'phone-call-02',\n campaign = 'clock-refresh',\n campaign_active = 'play',\n campaign_archived = 'archive',\n campaigns = 'clock-refresh',\n channel = 'zap',\n children = 'git-branch-01',\n check = 'check',\n checkbox = 'square',\n checkbox_checked = 'check-square',\n checkbox_partial = 'stop-square',\n close = 'x',\n compose = 'send-01',\n contact = 'user-01',\n contact_archived = 'archive',\n contact_blocked = 'message-x-square',\n contact_export = 'download-cloud-01',\n contact_import = 'upload-cloud-01',\n contact_stopped = 'slash-octagon',\n contact_updated = 'user-edit',\n contacts = 'user-01',\n copy = 'copy-04',\n dashboard = 'pie-chart-01',\n definitions_export = 'download-cloud-01',\n delete = 'trash-03',\n delete_small = 'x',\n down = 'chevron-down',\n download = 'download-01',\n drag = 'dots-grid',\n edit = 'edit-02',\n email = 'mail-01',\n error = 'alert-circle',\n event = 'zap',\n export = 'download-cloud-01',\n expressions = 'at-sign',\n fields = 'user-edit',\n filter = 'filter-funnel-01',\n flow = 'flow',\n flow_background = 'layers-two-01',\n flow_interrupted = 'x-close',\n flow_ivr = 'phone',\n flow_message = 'message-square-02',\n flow_surveyor = 'tablet-01',\n flow_user = 'hard-drive',\n flows = 'flow',\n follow = 'route',\n global = 'at-sign',\n grid = 'dots-grid',\n group = 'users-01',\n group_exclude = 'users-x',\n group_include = 'users-check',\n group_smart = 'atom-01',\n help = 'help-circle',\n hide = 'eye-off',\n home = 'settings-02',\n image = 'image-01',\n import = 'upload-cloud-01',\n inbox = 'inbox-01',\n incidents = 'alert-square',\n incoming_call = 'phone-incoming-01',\n info = 'user-square',\n integrations = 'layers-three-01',\n invitations = 'user-plus-01',\n issue = 'alert-square',\n label = 'tag-01',\n language = 'translate-01',\n link = 'link-external-01',\n location = 'marker-pin-01',\n log = 'file-02',\n logout = 'log-out-04',\n menu = 'menu-01',\n menu_collapse = 'chevron-left-double',\n message = 'message-square-02',\n message_export = 'download-cloud-01',\n messages = 'message-square-02',\n missing = 'maximize-02',\n missed_call = 'phone-x',\n new = 'plus',\n next_schedule = 'alarm-clock',\n note = 'edit-03',\n notes = 'edit-03',\n notification = 'bell-01',\n number = 'hash-01',\n optin_requested = 'message-notification-circle',\n optin = 'message-check-circle',\n optout = 'message-x-circle',\n org_active = 'credit-card-02',\n org_anonymous = 'glasses-01',\n org_bulk = 'credit-card-plus',\n org_flagged = 'flag-01',\n org_new = 'stars-02',\n org_suspended = 'slash-circle-01',\n org_verified = 'check-verified-02',\n overview = 'pie-chart-01',\n prometheus = 'prometheus',\n progress_spinner = 'refresh-cw-04',\n featured = 'star-01',\n quick_replies = 'dotpoints-01',\n recording = 'microphone-01',\n resend = 'refresh-cw-05',\n reset = 'flip-backward',\n resthooks = 'share-07',\n restore = 'play',\n results_export = 'download-cloud-01',\n retry = 'refresh-cw-05',\n revisions = 'clock-rewind',\n rocketchat = 'rocketchat',\n runs = 'rows-03',\n schedule = 'calendar',\n search = 'search-refraction',\n select_open = 'chevron-down',\n select_clear = 'x',\n send = 'send-03',\n service = 'magic-wand-01',\n service_end = 'log-out-04',\n settings = 'settings-02',\n shortcut = 'zap-fast',\n show = 'eye',\n simulator = 'phone-02',\n split = 'flow',\n sort = 'chevron-selector-vertical',\n sort_down = 'sort-arrow-down',\n sort_up = 'sort-arrow-up',\n staff = 'hard-drive',\n submit = 'check',\n success = 'check',\n template_approved = 'check-circle',\n template_pending = 'hourglass-01',\n template_rejected = 'alert-circle',\n tickets = 'agent',\n tickets_all = 'archive',\n tickets_closed = 'check',\n tickets_mine = 'coffee',\n tickets_mine_done = 'coffee-empty',\n tickets_open = 'inbox-01',\n tickets_export = 'download-cloud-01',\n tickets_unassigned = 'inbox-01',\n topic = 'message-text-circle-02',\n two_factor_enabled = 'shield-02',\n two_factor_disabled = 'shield-01',\n trigger = 'signal-01',\n trigger_active = 'play',\n trigger_archived = 'archive',\n trigger_new = 'plus',\n trigger_keyword = 'message-check-square',\n trigger_catch_all = 'message-question-square',\n trigger_inbound_call = 'phone-incoming-01',\n trigger_missed_call = 'phone-hang-up',\n trigger_schedule = 'calendar',\n trigger_new_conversation = 'message-chat-square',\n trigger_referral = 'user-right-01',\n trigger_closed_ticket = 'agent',\n trigger_opt_in = 'message-check-circle',\n trigger_opt_out = 'message-x-circle',\n triggers = 'signal-01',\n updated = 'edit-02',\n up = 'chevron-up',\n upload = 'upload-cloud-01',\n upload_image = 'camera-01',\n usages = 'link-04',\n user = 'users-01',\n user_beta = 'shield-zap',\n user_token = 'key-01',\n users = 'users-01',\n video = 'video-recorder',\n webhook = 'link-external-01',\n workspace = 'folder',\n zoom_fit = 'maximize-02',\n zoom_in = 'expand-06',\n\n // channel types\n channel_a = 'channel-android',\n channel_ac = 'zap', // TODO https://www.arabiacell.com/\n channel_at = 'zap', // TODO https://africastalking.com/\n channel_bs = 'zap', // TODO https://burstsms.com/\n channel_bw = 'zap', // TODO https://www.bandwidth.com/\n channel_cs = 'zap', // TODO https://www.clicksend.com/\n channel_ct = 'channel-clickatell',\n channel_d3 = 'channel-whatsapp',\n channel_d3c = 'channel-whatsapp',\n channel_da = 'zap', // TODO https://dartmedia.co.id/\n channel_ds = 'channel-discord',\n channel_ex = 'zap',\n channel_fb = 'channel-facebook',\n channel_fba = 'channel-facebook',\n channel_fc = 'channel-freshchat',\n channel_fcm = 'channel-firebase',\n channel_hm = 'zap', // TODO https://hormuud.com/\n channel_ib = 'zap', // TODO https://www.infobip.com/\n channel_ig = 'channel-instagram',\n channel_jc = 'channel-jiochat',\n channel_kn = 'channel-kannel',\n channel_kwa = 'channel-whatsapp',\n channel_ln = 'channel-line',\n channel_mt = 'channel-mtarget',\n channel_mtn = 'zap', // TODO https://mtn.com/\n channel_nx = 'channel-vonage',\n channel_pl = 'channel-plivo',\n channel_rc = 'channel-rocketchat',\n channel_sl = 'channel-slack',\n channel_sq = 'zap', // TODO https://shaqodoon.org/\n channel_st = 'zap', // TODO https://bulk.startmobile.ua\n channel_sw = 'channel-signalwire',\n channel_t = 'channel-twilio',\n channel_tg = 'channel-telegram',\n channel_tms = 'channel-twilio',\n channel_tq = 'channel-thinq',\n channel_tw = 'zap', // TODO https://www.somleng.org/\n channel_twa = 'channel-whatsapp',\n channel_twc = 'zap', // TODO\n channel_twt = 'channel-twitter',\n channel_vk = 'channel-vk',\n channel_vp = 'channel-viber',\n channel_wa = 'channel-whatsapp',\n channel_wac = 'channel-whatsapp',\n channel_wc = 'channel-wechat',\n channel_yo = 'zap', // TODO https://www.yo.co.ug/\n channel_zvw = 'channel-whatsapp',\n\n // ai\n ai_openai = 'openai',\n ai_anthropic = 'anthropic',\n ai_google = 'gemini',\n ai_microsoft = 'azure',\n ai_deepseek = 'deepseek',\n\n // classifiers\n classifier_wit = 'classifier-wit',\n\n // other brands\n dtone = 'dtone',\n zapier = 'zapier',\n\n // demo\n default = 'list',\n datepicker = 'calendar',\n slider = 'sliders-02',\n select = 'browser',\n input = 'edit-05'\n}\n"]}
|
|
@@ -49,7 +49,7 @@ export class Button extends LitElement {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.secondary-button:hover .button-mask {
|
|
52
|
-
border: 1px solid
|
|
52
|
+
border: 1px solid rgba(0, 0, 0, 0.15);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
.button-mask:hover {
|
|
@@ -103,7 +103,7 @@ export class Button extends LitElement {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
.secondary-button.active-button .button-mask {
|
|
106
|
-
border:
|
|
106
|
+
border: 1px solid transparent;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
.button-container.secondary-button.active-button:focus .button-mask {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","s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I,iBAAiB;YACrD,CAAC,CAAC,IAAI;uDACqC,UAAU;;;KAG5D,CAAC;IACJ,CAAC;CACF;AAxHC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;uCACX;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yCACT;AAGnB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yCACT;AAGnB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iCACrB;AAGN;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2CACP;AAGrB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qCACb;AAGf;IADC,QAAQ,EAAE;oCACE;AAGb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCACV;AAGlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0CACR;AAGpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;sCACZ;AAGhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qCACb;AAGf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qCACb;AAGf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oCACd;AAGb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qCACZ;AAGf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oCACb","sourcesContent":["import { LitElement, TemplateResult, html, css } from 'lit';\nimport { getClasses } from '../utils';\n\nimport { property } from 'lit/decorators.js';\n\nexport class Button extends LitElement {\n static get styles() {\n return css`\n :host {\n display: flex;\n align-self: stretch;\n font-family: var(--font-family);\n font-weight: 400;\n }\n\n .small {\n font-size: 0.8em;\n --button-y: 0px;\n --button-x: 0.5em;\n }\n\n .v-2.button-container {\n background: var(--button-bg);\n background-image: var(--button-bg-img);\n color: var(--button-text);\n box-shadow: var(--button-shadow);\n transition: all calc(var(--transition-speed) / 2) ease-in;\n }\n\n .button-container {\n color: #fff;\n cursor: pointer;\n display: flex;\n flex-grow: 1;\n border-radius: var(--curvature);\n outline: none;\n transition: background ease-in var(--transition-speed);\n user-select: none;\n -webkit-user-select: none;\n text-align: center;\n border: var(--button-border, none);\n }\n\n .button-name {\n white-space: nowrap;\n }\n\n .secondary-button:hover .button-mask {\n border: 1px solid var(--color-button-secondary);\n }\n\n .button-mask:hover {\n background: rgba(0, 0, 0, 0.05);\n }\n\n .button-container:focus {\n outline: none;\n margin: 0;\n }\n\n .button-container:focus {\n box-shadow: var(--widget-box-shadow-focused);\n }\n\n .button-container.secondary-button:focus .button-mask {\n background: transparent;\n }\n\n .button-mask {\n padding: var(--button-y) var(--button-x);\n border-radius: var(--curvature);\n border: 1px solid transparent;\n transition: var(--transition-speed);\n background: var(--button-mask);\n display: flex;\n align-items: center;\n }\n\n .button-container.disabled-button {\n background: rgba(0, 0, 0, 0.05);\n color: rgba(255, 255, 255, 0.45);\n cursor: default;\n }\n\n .button-container.disabled-button .button-mask {\n box-shadow: 0 0 0px 1px var(--color-button-disabled);\n }\n\n .button-container.disabled-button:hover .button-mask {\n box-shadow: 0 0 0px 1px var(--color-button-disabled);\n background: rgba(0, 0, 0, 0.05);\n }\n\n .button-container.active-button .button-mask {\n }\n\n .secondary-button.active-button {\n background: transparent;\n color: var(--color-text);\n }\n\n .secondary-button.active-button .button-mask {\n border: none;\n }\n\n .button-container.secondary-button.active-button:focus .button-mask {\n background: transparent;\n box-shadow: none;\n }\n\n .primary-button {\n background: var(--color-button-primary);\n color: var(--color-button-primary-text);\n }\n\n .affirmative {\n background: var(--color-button-attention);\n }\n\n .light-button {\n background: var(--color-button-light);\n color: var(--color-button-light-text);\n }\n\n .lined-button {\n border: 1px solid rgba(0, 0, 0, 0.1);\n color: rgba(0, 0, 0, 0.7);\n background: transparent;\n }\n\n .lined-button .button-mask {\n flex-grow: 1;\n }\n\n .lined-button .button-mask:hover {\n background: rgba(0, 0, 0, 0.03);\n }\n\n .icon-button {\n --button-y: 0.2em;\n --button-x: 0em;\n }\n\n .icon-button temba-icon {\n padding: 0 0.5em;\n }\n\n .attention-button {\n background: var(--color-button-attention);\n color: var(--color-button-primary-text);\n }\n\n .secondary-button {\n background: transparent;\n color: var(--color-text);\n }\n\n .destructive-button {\n background: var(--color-button-destructive);\n color: var(--color-button-destructive-text);\n }\n\n .button-mask.disabled-button {\n background: rgba(0, 0, 0, 0.1);\n }\n\n .secondary-button .button-mask:hover {\n background: transparent;\n }\n\n .submit-animation {\n padding: 1px 4px;\n }\n\n .submit-animation temba-loading {\n margin-bottom: -3px;\n line-height: normal;\n }\n `;\n }\n\n @property({ type: Boolean })\n primary: boolean;\n\n @property({ type: Boolean })\n secondary: boolean;\n\n @property({ type: Boolean })\n attention: boolean;\n\n @property({ type: Number })\n v = 1;\n\n @property({ type: Boolean })\n destructive: boolean;\n\n @property({ type: Boolean })\n light: boolean;\n\n @property()\n name: string;\n\n @property({ type: Boolean })\n disabled: boolean;\n\n @property({ type: Boolean })\n submitting: boolean;\n\n @property({ type: Boolean })\n active: boolean;\n\n @property({ type: Boolean })\n small: boolean;\n\n @property({ type: Boolean })\n lined: boolean;\n\n @property({ type: String })\n href: string;\n\n @property({ type: Number })\n index?: number;\n\n @property({ type: String })\n icon?: string;\n\n private handleClick(evt: MouseEvent) {\n if (this.disabled) {\n evt.preventDefault();\n evt.stopPropagation();\n }\n\n if (this.href && !this.disabled) {\n this.ownerDocument.location.href = this.href;\n evt.preventDefault();\n evt.stopPropagation();\n }\n }\n\n private handleKeyUp(event: KeyboardEvent): void {\n this.active = false;\n if (event.key === 'Enter') {\n this.click();\n }\n }\n\n private handleMouseDown(): void {\n if (!this.disabled && !this.submitting) {\n this.active = true;\n this.classList.add('active');\n }\n }\n\n private handleMouseUp(): void {\n this.active = false;\n this.classList.remove('active');\n }\n\n public render(): TemplateResult {\n const buttonName = this.submitting\n ? html`<div class=\"submit-animation\">\n <temba-loading units=\"3\" size=\"8\" color=\"#eee\"></temba-loading>\n </div>`\n : this.name;\n\n return html`\n <div\n class=\"button-container \n v-${this.v}\n ${getClasses({\n 'primary-button':\n this.primary ||\n (!this.primary &&\n !this.secondary &&\n !this.attention &&\n this.v == 1),\n 'secondary-button': this.secondary,\n 'disabled-button': this.disabled,\n 'active-button': this.active,\n 'attention-button': this.attention,\n 'destructive-button': this.destructive,\n 'light-button': this.light,\n 'lined-button': this.lined,\n 'icon-button': !!this.icon,\n small: this.small\n })}\"\n tabindex=\"0\"\n @mousedown=${this.handleMouseDown}\n @mouseup=${this.handleMouseUp}\n @mouseleave=${this.handleMouseUp}\n @keyup=${this.handleKeyUp}\n @click=${this.handleClick}\n >\n <div class=\"button-mask\">\n ${this.icon\n ? html`<temba-icon name=\"${this.icon}\"></temba-icon>`\n : null}\n <div class=\"button-name\"><slot name=\"name\">${buttonName}</slot></div>\n </div>\n </div>\n `;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/display/Button.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAkB,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,MAAM,OAAO,MAAO,SAAQ,UAAU;IAAtC;;QA0LE,MAAC,GAAG,CAAC,CAAC;IA+GR,CAAC;IAxSC,MAAM,KAAK,MAAM;QACf,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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qCACb;AAGf;IADC,QAAQ,EAAE;oCACE;AAGb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCACV;AAGlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0CACR;AAGpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;sCACZ;AAGhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qCACb;AAGf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qCACb;AAGf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oCACd;AAGb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qCACZ;AAGf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oCACb","sourcesContent":["import { LitElement, TemplateResult, html, css } from 'lit';\nimport { getClasses } from '../utils';\n\nimport { property } from 'lit/decorators.js';\n\nexport class Button extends LitElement {\n static get styles() {\n return css`\n :host {\n display: flex;\n align-self: stretch;\n font-family: var(--font-family);\n font-weight: 400;\n }\n\n .small {\n font-size: 0.8em;\n --button-y: 0px;\n --button-x: 0.5em;\n }\n\n .v-2.button-container {\n background: var(--button-bg);\n background-image: var(--button-bg-img);\n color: var(--button-text);\n box-shadow: var(--button-shadow);\n transition: all calc(var(--transition-speed) / 2) ease-in;\n }\n\n .button-container {\n color: #fff;\n cursor: pointer;\n display: flex;\n flex-grow: 1;\n border-radius: var(--curvature);\n outline: none;\n transition: background ease-in var(--transition-speed);\n user-select: none;\n -webkit-user-select: none;\n text-align: center;\n border: var(--button-border, none);\n }\n\n .button-name {\n white-space: nowrap;\n }\n\n .secondary-button:hover .button-mask {\n border: 1px solid rgba(0, 0, 0, 0.15);\n }\n\n .button-mask:hover {\n background: rgba(0, 0, 0, 0.05);\n }\n\n .button-container:focus {\n outline: none;\n margin: 0;\n }\n\n .button-container:focus {\n box-shadow: var(--widget-box-shadow-focused);\n }\n\n .button-container.secondary-button:focus .button-mask {\n background: transparent;\n }\n\n .button-mask {\n padding: var(--button-y) var(--button-x);\n border-radius: var(--curvature);\n border: 1px solid transparent;\n transition: var(--transition-speed);\n background: var(--button-mask);\n display: flex;\n align-items: center;\n }\n\n .button-container.disabled-button {\n background: rgba(0, 0, 0, 0.05);\n color: rgba(255, 255, 255, 0.45);\n cursor: default;\n }\n\n .button-container.disabled-button .button-mask {\n box-shadow: 0 0 0px 1px var(--color-button-disabled);\n }\n\n .button-container.disabled-button:hover .button-mask {\n box-shadow: 0 0 0px 1px var(--color-button-disabled);\n background: rgba(0, 0, 0, 0.05);\n }\n\n .button-container.active-button .button-mask {\n }\n\n .secondary-button.active-button {\n background: transparent;\n color: var(--color-text);\n }\n\n .secondary-button.active-button .button-mask {\n border: 1px solid transparent;\n }\n\n .button-container.secondary-button.active-button:focus .button-mask {\n background: transparent;\n box-shadow: none;\n }\n\n .primary-button {\n background: var(--color-button-primary);\n color: var(--color-button-primary-text);\n }\n\n .affirmative {\n background: var(--color-button-attention);\n }\n\n .light-button {\n background: var(--color-button-light);\n color: var(--color-button-light-text);\n }\n\n .lined-button {\n border: 1px solid rgba(0, 0, 0, 0.1);\n color: rgba(0, 0, 0, 0.7);\n background: transparent;\n }\n\n .lined-button .button-mask {\n flex-grow: 1;\n }\n\n .lined-button .button-mask:hover {\n background: rgba(0, 0, 0, 0.03);\n }\n\n .icon-button {\n --button-y: 0.2em;\n --button-x: 0em;\n }\n\n .icon-button temba-icon {\n padding: 0 0.5em;\n }\n\n .attention-button {\n background: var(--color-button-attention);\n color: var(--color-button-primary-text);\n }\n\n .secondary-button {\n background: transparent;\n color: var(--color-text);\n }\n\n .destructive-button {\n background: var(--color-button-destructive);\n color: var(--color-button-destructive-text);\n }\n\n .button-mask.disabled-button {\n background: rgba(0, 0, 0, 0.1);\n }\n\n .secondary-button .button-mask:hover {\n background: transparent;\n }\n\n .submit-animation {\n padding: 1px 4px;\n }\n\n .submit-animation temba-loading {\n margin-bottom: -3px;\n line-height: normal;\n }\n `;\n }\n\n @property({ type: Boolean })\n primary: boolean;\n\n @property({ type: Boolean })\n secondary: boolean;\n\n @property({ type: Boolean })\n attention: boolean;\n\n @property({ type: Number })\n v = 1;\n\n @property({ type: Boolean })\n destructive: boolean;\n\n @property({ type: Boolean })\n light: boolean;\n\n @property()\n name: string;\n\n @property({ type: Boolean })\n disabled: boolean;\n\n @property({ type: Boolean })\n submitting: boolean;\n\n @property({ type: Boolean })\n active: boolean;\n\n @property({ type: Boolean })\n small: boolean;\n\n @property({ type: Boolean })\n lined: boolean;\n\n @property({ type: String })\n href: string;\n\n @property({ type: Number })\n index?: number;\n\n @property({ type: String })\n icon?: string;\n\n private handleClick(evt: MouseEvent) {\n if (this.disabled) {\n evt.preventDefault();\n evt.stopPropagation();\n }\n\n if (this.href && !this.disabled) {\n this.ownerDocument.location.href = this.href;\n evt.preventDefault();\n evt.stopPropagation();\n }\n }\n\n private handleKeyUp(event: KeyboardEvent): void {\n this.active = false;\n if (event.key === 'Enter') {\n this.click();\n }\n }\n\n private handleMouseDown(): void {\n if (!this.disabled && !this.submitting) {\n this.active = true;\n this.classList.add('active');\n }\n }\n\n private handleMouseUp(): void {\n this.active = false;\n this.classList.remove('active');\n }\n\n public render(): TemplateResult {\n const buttonName = this.submitting\n ? html`<div class=\"submit-animation\">\n <temba-loading units=\"3\" size=\"8\" color=\"#eee\"></temba-loading>\n </div>`\n : this.name;\n\n return html`\n <div\n class=\"button-container \n v-${this.v}\n ${getClasses({\n 'primary-button':\n this.primary ||\n (!this.primary &&\n !this.secondary &&\n !this.attention &&\n this.v == 1),\n 'secondary-button': this.secondary,\n 'disabled-button': this.disabled,\n 'active-button': this.active,\n 'attention-button': this.attention,\n 'destructive-button': this.destructive,\n 'light-button': this.light,\n 'lined-button': this.lined,\n 'icon-button': !!this.icon,\n small: this.small\n })}\"\n tabindex=\"0\"\n @mousedown=${this.handleMouseDown}\n @mouseup=${this.handleMouseUp}\n @mouseleave=${this.handleMouseUp}\n @keyup=${this.handleKeyUp}\n @click=${this.handleClick}\n >\n <div class=\"button-mask\">\n ${this.icon\n ? html`<temba-icon name=\"${this.icon}\"></temba-icon>`\n : null}\n <div class=\"button-name\"><slot name=\"name\">${buttonName}</slot></div>\n </div>\n </div>\n `;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingTab.js","sourceRoot":"","sources":["../../../src/display/FloatingTab.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAoC,MAAM,KAAK,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,MAAM,OAAO,WAAY,SAAQ,YAAY;IAA7C;;QA0EE,UAAK,GAAG,SAAS,CAAC;QAGlB,UAAK,GAAG,CAAC,CAAC;QAGV,QAAG,GAAG,GAAG,CAAC;QAGV,WAAM,GAAG,KAAK,CAAC;IAgFjB,CAAC;IAlKC,MAAM,KAAK,MAAM;QACf,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAyDT,CAAC;IACJ,CAAC;IAyBD,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/B,WAAW,CAAC,kBAAkB,EAAE,CAAC;IACnC,CAAC;IAED,oBAAoB;QAClB,KAAK,CAAC,oBAAoB,EAAE,CAAC;QAC7B,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,O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CAAC,CAAC;IACL,CAAC;IAEM,MAAM,CAAC,WAAW;QACvB,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YAClC,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,MAAM;QACX,MAAM,QAAQ,GAAG;0BACK,IAAI,CAAC,KAAK;aACvB,IAAI,CAAC,GAAG;KAChB,CAAC;QAEF,MAAM,OAAO,GAAG,UAAU,CAAC;YACzB,GAAG,EAAE,IAAI;YACT,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAC;QAEH,OAAO,IAAI,CAAA;oBACK,OAAO,YAAY,QAAQ,YAAY,IAAI,CAAC,WAAW;;YAE/D,IAAI,CAAC,IAAI;YACT,CAAC,CAAC,IAAI,CAAA,gCAAgC,IAAI,CAAC,IAAI,iBAAiB;YAChE,CAAC,CAAC,EAAE;;6BAEa,IAAI,CAAC,KAAK;;KAElC,CAAC;IACJ,CAAC;;AApGM,sBAAU,GAAG,EAAE,AAAL,CAAM;AAChB,mBAAO,GAAG,CAAC,AAAJ,CAAK;AACZ,qBAAS,GAAG,GAAG,AAAN,CAAO;AAChB,mBAAO,GAAkB,EAAE,AAApB,CAAqB;AAGnC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCACd;AAGb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CACb;AAGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CACT;AAGlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CACjB;AAGV;IADC,KAAK,EAAE;wCACE;AAGV;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2CACb","sourcesContent":["import { css, html, PropertyValueMap, TemplateResult } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { RapidElement } from '../RapidElement';\nimport { CustomEventType } from '../interfaces';\nimport { getClasses } from '../utils';\n\nexport class FloatingTab extends RapidElement {\n static get styles() {\n return css`\n .tab.hidden {\n transform: translateX(calc(100% + var(--floating-tab-right, 0px)));\n }\n .tab {\n position: fixed;\n right: var(--floating-tab-right, 0px);\n z-index: 4998;\n display: flex;\n align-items: center;\n padding: 12px;\n border-top-left-radius: 8px;\n border-bottom-left-radius: 8px;\n cursor: pointer;\n box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.2);\n transition: transform calc(var(--transition-duration, 300ms) * 0.7)\n ease-in-out,\n padding-right calc(var(--transition-duration, 300ms) * 0.7)\n ease-in-out,\n box-shadow calc(var(--transition-duration, 300ms) * 0.7) ease-in-out;\n user-select: none;\n }\n\n .tab:hover {\n padding-right: 16px;\n box-shadow: -4px 4px 12px rgba(0, 0, 0, 0.3);\n }\n\n .icon-container {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 16px;\n height: 16px;\n }\n\n temba-icon {\n --icon-color: white;\n }\n\n .label {\n color: white;\n font-weight: 500;\n font-size: 16px;\n max-width: 0;\n overflow: hidden;\n white-space: nowrap;\n margin-left: 0;\n opacity: 0;\n transition: all var(--transition-duration, 300ms) ease-in-out;\n }\n\n .tab:hover .label {\n max-width: 200px;\n margin-left: 12px;\n opacity: 1;\n }\n `;\n }\n\n static TAB_HEIGHT = 50;\n static TAB_GAP = 4;\n static START_TOP = 115;\n static allTabs: FloatingTab[] = [];\n\n @property({ type: String })\n icon: string;\n\n @property({ type: String })\n label: string;\n\n @property({ type: String })\n color = '#6B7280';\n\n @property({ type: Number })\n order = 0;\n\n @state()\n top = 100;\n\n @property({ type: Boolean })\n hidden = false;\n\n connectedCallback() {\n super.connectedCallback();\n FloatingTab.allTabs.push(this);\n FloatingTab.updateAllPositions();\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n const index = FloatingTab.allTabs.indexOf(this);\n if (index > -1) {\n FloatingTab.allTabs.splice(index, 1);\n }\n FloatingTab.updateAllPositions();\n }\n\n public static updateAllPositions() {\n const sorted = [...FloatingTab.allTabs].sort((a, b) => a.order - b.order);\n sorted.forEach((tab, index) => {\n tab.top =\n FloatingTab.START_TOP +\n index * (FloatingTab.TAB_HEIGHT + FloatingTab.TAB_GAP);\n });\n }\n\n public updated(\n changes: PropertyValueMap<any> | Map<PropertyKey, unknown>\n ): void {\n super.updated(changes);\n if (changes.has('hidden')) {\n this.classList.toggle('hidden', this.hidden);\n }\n }\n\n private handleClick() {\n // hide all tabs when one is clicked\n FloatingTab.allTabs.forEach((tab) => {\n tab.hidden = true;\n });\n\n this.fireCustomEvent(CustomEventType.ButtonClicked, {\n action: 'toggle'\n });\n }\n\n public static showAllTabs() {\n FloatingTab.allTabs.forEach((tab) => {\n tab.hidden = false;\n });\n }\n\n public static hideAllTabs() {\n FloatingTab.allTabs.forEach((tab) => {\n tab.hidden = true;\n });\n }\n\n public render(): TemplateResult {\n const tabStyle = `\n background-color: ${this.color};\n top: ${this.top}px;\n `;\n\n const classes = getClasses({\n tab: true,\n hidden: this.hidden\n });\n\n return html`\n <div class=\"${classes}\" style=\"${tabStyle}\" @click=${this.handleClick}>\n <div class=\"icon-container\">\n ${this.icon\n ? html`<temba-icon size=\"1.5\" name=\"${this.icon}\"></temba-icon>`\n : ''}\n </div>\n <div class=\"label\">${this.label}</div>\n </div>\n `;\n }\n}\n"]}
|
|
@@ -14,6 +14,7 @@ export class CanvasMenu extends RapidElement {
|
|
|
14
14
|
this.y = 0;
|
|
15
15
|
this.open = false;
|
|
16
16
|
this.showStickyNote = true;
|
|
17
|
+
this.showReflow = false;
|
|
17
18
|
this.clickPosition = { x: 0, y: 0 };
|
|
18
19
|
}
|
|
19
20
|
static get styles() {
|
|
@@ -97,11 +98,12 @@ export class CanvasMenu extends RapidElement {
|
|
|
97
98
|
document.removeEventListener('mousedown', this._clickOutsideHandler);
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
|
-
show(x, y, clickPosition, showStickyNote = true) {
|
|
101
|
+
show(x, y, clickPosition, showStickyNote = true, showReflow = false) {
|
|
101
102
|
this.x = x;
|
|
102
103
|
this.y = y;
|
|
103
104
|
this.clickPosition = clickPosition;
|
|
104
105
|
this.showStickyNote = showStickyNote;
|
|
106
|
+
this.showReflow = showReflow;
|
|
105
107
|
this.open = true;
|
|
106
108
|
// Adjust position after menu renders to ensure it fits on screen
|
|
107
109
|
requestAnimationFrame(() => {
|
|
@@ -198,6 +200,24 @@ export class CanvasMenu extends RapidElement {
|
|
|
198
200
|
</div>
|
|
199
201
|
`
|
|
200
202
|
: ''}
|
|
203
|
+
${this.showReflow
|
|
204
|
+
? html `
|
|
205
|
+
<div class="divider"></div>
|
|
206
|
+
|
|
207
|
+
<div
|
|
208
|
+
class="menu-item"
|
|
209
|
+
@click=${() => this.handleMenuItemClick('reflow')}
|
|
210
|
+
>
|
|
211
|
+
<temba-icon name="flow" size="1.25"></temba-icon>
|
|
212
|
+
<div class="menu-item-content">
|
|
213
|
+
<div class="menu-item-title">Reflow</div>
|
|
214
|
+
<div class="menu-item-description">
|
|
215
|
+
Auto-arrange nodes in this flow
|
|
216
|
+
</div>
|
|
217
|
+
</div>
|
|
218
|
+
</div>
|
|
219
|
+
`
|
|
220
|
+
: ''}
|
|
201
221
|
</div>
|
|
202
222
|
`;
|
|
203
223
|
}
|
|
@@ -214,6 +234,9 @@ __decorate([
|
|
|
214
234
|
__decorate([
|
|
215
235
|
property({ type: Boolean })
|
|
216
236
|
], CanvasMenu.prototype, "showStickyNote", void 0);
|
|
237
|
+
__decorate([
|
|
238
|
+
property({ type: Boolean })
|
|
239
|
+
], CanvasMenu.prototype, "showReflow", void 0);
|
|
217
240
|
__decorate([
|
|
218
241
|
state()
|
|
219
242
|
], CanvasMenu.prototype, "clickPosition", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CanvasMenu.js","sourceRoot":"","sources":["../../../src/flow/CanvasMenu.ts"],"names":[],"mappings":";AAAA,OA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;;;;;;;;aAUpD;YACH,CAAC,CAAC,EAAE;;KAET,CAAC;IACJ,CAAC;CACF;AAlKQ;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qCACd;AAGN;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qCACd;AAGN;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCACR;AAGb;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kDACC;AAGrB;IADP,KAAK,EAAE;iDAC+B","sourcesContent":["import { css, html, PropertyValueMap, TemplateResult } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { RapidElement } from '../RapidElement';\nimport { CustomEventType } from '../interfaces';\n\n/**\n * Event detail for canvas menu selection\n */\nexport interface CanvasMenuSelection {\n action: 'sticky' | 'action' | 'split';\n position: { x: number; y: number };\n}\n\n/**\n * CanvasMenu - A popup menu for adding items to the flow canvas\n * Displayed when double-clicking on empty canvas space\n */\nexport class CanvasMenu extends RapidElement {\n static get styles() {\n return css`\n :host {\n position: fixed;\n z-index: 10000;\n display: block;\n pointer-events: none;\n }\n\n .menu {\n position: fixed;\n background: white;\n border-radius: var(--curvature);\n box-shadow: var(--dropdown-shadow);\n padding: 0.5em 0;\n width: 265px;\n pointer-events: auto;\n }\n\n .menu-item {\n padding: 0.75em 1.5em;\n cursor: pointer;\n display: flex;\n align-items: flex-start;\n gap: 0.75em;\n transition: background-color 0.15s ease;\n }\n\n .menu-item:hover {\n background-color: rgba(0, 0, 0, 0.05);\n }\n\n .menu-item temba-icon {\n --icon-color: var(--color-text);\n margin-top: 0.15em;\n }\n\n .menu-item-content {\n display: flex;\n flex-direction: column;\n gap: 0.15em;\n }\n\n .menu-item-title {\n font-weight: 500;\n font-size: 1rem;\n color: var(--color-text-dark);\n }\n\n .menu-item-description {\n font-size: 0.85rem;\n color: var(--color-text);\n }\n\n .divider {\n height: 1px;\n background: rgba(0, 0, 0, 0.1);\n margin: 0.5em 0;\n }\n `;\n }\n\n @property({ type: Number })\n public x = 0;\n\n @property({ type: Number })\n public y = 0;\n\n @property({ type: Boolean })\n public open = false;\n\n @property({ type: Boolean })\n public showStickyNote = true;\n\n @state()\n private clickPosition = { x: 0, y: 0 };\n\n protected firstUpdated(\n _changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>\n ): void {\n super.firstUpdated(_changedProperties);\n\n // Close menu when clicking outside — use mousedown instead of click\n // to avoid being triggered by the click synthesized from a drag-and-drop\n // (mousedown on exit + mouseup on canvas = click on common ancestor)\n const handleClickOutside = (e: MouseEvent) => {\n if (this.open && !this.contains(e.target as Node)) {\n this.close();\n }\n };\n\n document.addEventListener('mousedown', handleClickOutside);\n\n // Store cleanup function\n (this as any)._clickOutsideHandler = handleClickOutside;\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n if ((this as any)._clickOutsideHandler) {\n document.removeEventListener(\n 'mousedown',\n (this as any)._clickOutsideHandler\n );\n }\n }\n\n public show(\n x: number,\n y: number,\n clickPosition: { x: number; y: number },\n showStickyNote: boolean = true\n ) {\n this.x = x;\n this.y = y;\n this.clickPosition = clickPosition;\n this.showStickyNote = showStickyNote;\n this.open = true;\n\n // Adjust position after menu renders to ensure it fits on screen\n requestAnimationFrame(() => {\n this.adjustPosition();\n });\n }\n\n private adjustPosition(): void {\n const menuElement = this.shadowRoot?.querySelector('.menu') as HTMLElement;\n if (!menuElement) return;\n\n const menuRect = menuElement.getBoundingClientRect();\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n const margin = 10; // margin from viewport edges\n\n let adjustedX = this.x;\n let adjustedY = this.y;\n\n // Check if menu goes off the right edge\n if (this.x + menuRect.width + margin > viewportWidth) {\n adjustedX = viewportWidth - menuRect.width - margin;\n }\n\n // Check if menu goes off the bottom edge\n if (this.y + menuRect.height + margin > viewportHeight) {\n adjustedY = viewportHeight - menuRect.height - margin;\n }\n\n // Update position if needed\n if (adjustedX !== this.x || adjustedY !== this.y) {\n this.x = adjustedX;\n this.y = adjustedY;\n }\n }\n\n public close(fireCanceledEvent: boolean = true) {\n if (this.open) {\n this.open = false;\n // Fire close event so parent can clean up, but only if not from a selection\n if (fireCanceledEvent) {\n this.fireCustomEvent(CustomEventType.Canceled, {});\n }\n }\n }\n\n private handleMenuItemClick(action: 'sticky' | 'action' | 'split') {\n this.fireCustomEvent(CustomEventType.Selection, {\n action,\n position: this.clickPosition\n } as CanvasMenuSelection);\n // Close without firing canceled event since we made a selection\n this.close(false);\n }\n\n public render(): TemplateResult {\n if (!this.open) {\n return html``;\n }\n\n return html`\n <div class=\"menu\" style=\"left: ${this.x}px; top: ${this.y}px;\">\n <div\n class=\"menu-item\"\n @click=${() => this.handleMenuItemClick('action')}\n >\n <temba-icon name=\"action\" size=\"1.25\"></temba-icon>\n <div class=\"menu-item-content\">\n <div class=\"menu-item-title\">Add Action</div>\n <div class=\"menu-item-description\">\n Send messages, update contacts\n </div>\n </div>\n </div>\n\n <div\n class=\"menu-item\"\n @click=${() => this.handleMenuItemClick('split')}\n >\n <temba-icon name=\"split\" size=\"1.25\"></temba-icon>\n <div class=\"menu-item-content\">\n <div class=\"menu-item-title\">Add Split</div>\n <div class=\"menu-item-description\">Branch based on conditions</div>\n </div>\n </div>\n\n ${this.showStickyNote\n ? html`\n <div class=\"divider\"></div>\n\n <div\n class=\"menu-item\"\n @click=${() => this.handleMenuItemClick('sticky')}\n >\n <temba-icon name=\"note\" size=\"1.25\"></temba-icon>\n <div class=\"menu-item-content\">\n <div class=\"menu-item-title\">Add Sticky Note</div>\n <div class=\"menu-item-description\">\n Add a note to the canvas\n </div>\n </div>\n </div>\n `\n : ''}\n </div>\n `;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"CanvasMenu.js","sourceRoot":"","sources":["../../../src/flow/CanvasMenu.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAoC,MAAM,KAAK,C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CAAC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC;;;;;;;;;;aAUpD;YACH,CAAC,CAAC,EAAE;UACJ,IAAI,CAAC,UAAU;YACf,CAAC,CAAC,IAAI,CAAA;;;;;yBAKS,GAAG,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC;;;;;;;;;;aAUpD;YACH,CAAC,CAAC,EAAE;;KAET,CAAC;IACJ,CAAC;CACF;AA3LQ;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qCACd;AAGN;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qCACd;AAGN;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCACR;AAGb;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kDACC;AAGtB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;8CACF;AAGlB;IADP,KAAK,EAAE;iDAC+B","sourcesContent":["import { css, html, PropertyValueMap, TemplateResult } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { RapidElement } from '../RapidElement';\nimport { CustomEventType } from '../interfaces';\n\n/**\n * Event detail for canvas menu selection\n */\nexport interface CanvasMenuSelection {\n action: 'sticky' | 'action' | 'split' | 'reflow';\n position: { x: number; y: number };\n}\n\n/**\n * CanvasMenu - A popup menu for adding items to the flow canvas\n * Displayed when double-clicking on empty canvas space\n */\nexport class CanvasMenu extends RapidElement {\n static get styles() {\n return css`\n :host {\n position: fixed;\n z-index: 10000;\n display: block;\n pointer-events: none;\n }\n\n .menu {\n position: fixed;\n background: white;\n border-radius: var(--curvature);\n box-shadow: var(--dropdown-shadow);\n padding: 0.5em 0;\n width: 265px;\n pointer-events: auto;\n }\n\n .menu-item {\n padding: 0.75em 1.5em;\n cursor: pointer;\n display: flex;\n align-items: flex-start;\n gap: 0.75em;\n transition: background-color 0.15s ease;\n }\n\n .menu-item:hover {\n background-color: rgba(0, 0, 0, 0.05);\n }\n\n .menu-item temba-icon {\n --icon-color: var(--color-text);\n margin-top: 0.15em;\n }\n\n .menu-item-content {\n display: flex;\n flex-direction: column;\n gap: 0.15em;\n }\n\n .menu-item-title {\n font-weight: 500;\n font-size: 1rem;\n color: var(--color-text-dark);\n }\n\n .menu-item-description {\n font-size: 0.85rem;\n color: var(--color-text);\n }\n\n .divider {\n height: 1px;\n background: rgba(0, 0, 0, 0.1);\n margin: 0.5em 0;\n }\n `;\n }\n\n @property({ type: Number })\n public x = 0;\n\n @property({ type: Number })\n public y = 0;\n\n @property({ type: Boolean })\n public open = false;\n\n @property({ type: Boolean })\n public showStickyNote = true;\n\n @property({ type: Boolean })\n public showReflow = false;\n\n @state()\n private clickPosition = { x: 0, y: 0 };\n\n protected firstUpdated(\n _changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>\n ): void {\n super.firstUpdated(_changedProperties);\n\n // Close menu when clicking outside — use mousedown instead of click\n // to avoid being triggered by the click synthesized from a drag-and-drop\n // (mousedown on exit + mouseup on canvas = click on common ancestor)\n const handleClickOutside = (e: MouseEvent) => {\n if (this.open && !this.contains(e.target as Node)) {\n this.close();\n }\n };\n\n document.addEventListener('mousedown', handleClickOutside);\n\n // Store cleanup function\n (this as any)._clickOutsideHandler = handleClickOutside;\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n if ((this as any)._clickOutsideHandler) {\n document.removeEventListener(\n 'mousedown',\n (this as any)._clickOutsideHandler\n );\n }\n }\n\n public show(\n x: number,\n y: number,\n clickPosition: { x: number; y: number },\n showStickyNote: boolean = true,\n showReflow: boolean = false\n ) {\n this.x = x;\n this.y = y;\n this.clickPosition = clickPosition;\n this.showStickyNote = showStickyNote;\n this.showReflow = showReflow;\n this.open = true;\n\n // Adjust position after menu renders to ensure it fits on screen\n requestAnimationFrame(() => {\n this.adjustPosition();\n });\n }\n\n private adjustPosition(): void {\n const menuElement = this.shadowRoot?.querySelector('.menu') as HTMLElement;\n if (!menuElement) return;\n\n const menuRect = menuElement.getBoundingClientRect();\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n const margin = 10; // margin from viewport edges\n\n let adjustedX = this.x;\n let adjustedY = this.y;\n\n // Check if menu goes off the right edge\n if (this.x + menuRect.width + margin > viewportWidth) {\n adjustedX = viewportWidth - menuRect.width - margin;\n }\n\n // Check if menu goes off the bottom edge\n if (this.y + menuRect.height + margin > viewportHeight) {\n adjustedY = viewportHeight - menuRect.height - margin;\n }\n\n // Update position if needed\n if (adjustedX !== this.x || adjustedY !== this.y) {\n this.x = adjustedX;\n this.y = adjustedY;\n }\n }\n\n public close(fireCanceledEvent: boolean = true) {\n if (this.open) {\n this.open = false;\n // Fire close event so parent can clean up, but only if not from a selection\n if (fireCanceledEvent) {\n this.fireCustomEvent(CustomEventType.Canceled, {});\n }\n }\n }\n\n private handleMenuItemClick(\n action: 'sticky' | 'action' | 'split' | 'reflow'\n ) {\n this.fireCustomEvent(CustomEventType.Selection, {\n action,\n position: this.clickPosition\n } as CanvasMenuSelection);\n // Close without firing canceled event since we made a selection\n this.close(false);\n }\n\n public render(): TemplateResult {\n if (!this.open) {\n return html``;\n }\n\n return html`\n <div class=\"menu\" style=\"left: ${this.x}px; top: ${this.y}px;\">\n <div\n class=\"menu-item\"\n @click=${() => this.handleMenuItemClick('action')}\n >\n <temba-icon name=\"action\" size=\"1.25\"></temba-icon>\n <div class=\"menu-item-content\">\n <div class=\"menu-item-title\">Add Action</div>\n <div class=\"menu-item-description\">\n Send messages, update contacts\n </div>\n </div>\n </div>\n\n <div\n class=\"menu-item\"\n @click=${() => this.handleMenuItemClick('split')}\n >\n <temba-icon name=\"split\" size=\"1.25\"></temba-icon>\n <div class=\"menu-item-content\">\n <div class=\"menu-item-title\">Add Split</div>\n <div class=\"menu-item-description\">Branch based on conditions</div>\n </div>\n </div>\n\n ${this.showStickyNote\n ? html`\n <div class=\"divider\"></div>\n\n <div\n class=\"menu-item\"\n @click=${() => this.handleMenuItemClick('sticky')}\n >\n <temba-icon name=\"note\" size=\"1.25\"></temba-icon>\n <div class=\"menu-item-content\">\n <div class=\"menu-item-title\">Add Sticky Note</div>\n <div class=\"menu-item-description\">\n Add a note to the canvas\n </div>\n </div>\n </div>\n `\n : ''}\n ${this.showReflow\n ? html`\n <div class=\"divider\"></div>\n\n <div\n class=\"menu-item\"\n @click=${() => this.handleMenuItemClick('reflow')}\n >\n <temba-icon name=\"flow\" size=\"1.25\"></temba-icon>\n <div class=\"menu-item-content\">\n <div class=\"menu-item-title\">Reflow</div>\n <div class=\"menu-item-description\">\n Auto-arrange nodes in this flow\n </div>\n </div>\n </div>\n `\n : ''}\n </div>\n `;\n }\n}\n"]}
|
|
@@ -6,6 +6,7 @@ import { ACTION_GROUP_METADATA, SPLIT_GROUP_METADATA } from './types';
|
|
|
6
6
|
import { property } from 'lit/decorators.js';
|
|
7
7
|
import { RapidElement } from '../RapidElement';
|
|
8
8
|
import { getClasses } from '../utils';
|
|
9
|
+
import { isRightClick } from './utils';
|
|
9
10
|
import { getStore } from '../store/Store';
|
|
10
11
|
import { CustomEventType } from '../interfaces';
|
|
11
12
|
import { fromStore, zustand } from '../store/AppState';
|
|
@@ -704,8 +705,8 @@ export class CanvasNode extends RapidElement {
|
|
|
704
705
|
const actionId = event.detail.id;
|
|
705
706
|
const actionElement = this.querySelector(`#${actionId}`);
|
|
706
707
|
if (actionElement) {
|
|
707
|
-
|
|
708
|
-
this.draggedActionHeight =
|
|
708
|
+
// Use offsetHeight (unaffected by ancestor CSS transforms like zoom)
|
|
709
|
+
this.draggedActionHeight = actionElement.offsetHeight;
|
|
709
710
|
}
|
|
710
711
|
else {
|
|
711
712
|
// Fallback to a reasonable default
|
|
@@ -786,6 +787,8 @@ export class CanvasNode extends RapidElement {
|
|
|
786
787
|
return { x: rect.left + rect.width / 2, y: rect.top };
|
|
787
788
|
}
|
|
788
789
|
handleActionMouseDown(event, action) {
|
|
790
|
+
if (isRightClick(event))
|
|
791
|
+
return;
|
|
789
792
|
// Don't handle clicks on the remove button, drag handle, or when action is in removing state
|
|
790
793
|
const target = event.target;
|
|
791
794
|
if (target.closest('.remove-button') ||
|
|
@@ -889,6 +892,8 @@ export class CanvasNode extends RapidElement {
|
|
|
889
892
|
}
|
|
890
893
|
}
|
|
891
894
|
handleNodeMouseDown(event) {
|
|
895
|
+
if (isRightClick(event))
|
|
896
|
+
return;
|
|
892
897
|
// Don't handle clicks on the remove button, exits, drag handle, or when node is in removing state
|
|
893
898
|
const target = event.target;
|
|
894
899
|
if (target.closest('.remove-button') ||
|