Skip to content

Commit 7507a41

Browse files
committed
chore: add proConstants for declared ordering for live preview tool box items
1 parent 9941a9c commit 7507a41

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

src/extensionsIntegrated/phoenix-pro/browser-context/hyperlink-editor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: LicenseRef-Proprietary
44
*/
55

6-
/*global GLOBALS, LivePreviewView, cssStyles, strings, icons*/
6+
/*global GLOBALS, LivePreviewView, cssStyles, strings, icons, proConstants*/
77

88
let _hyperlinkEditor;
99

@@ -144,7 +144,7 @@ function _handleEditHyperlinkOptionClick(event, element) {
144144
function renderHyperlinkOptions(element, shadow) {
145145
if (element && element.tagName.toLowerCase() === 'a') {
146146
return {
147-
listOrder: 50,
147+
listOrder: proConstants.TOOLBOX_ORDERING.EDIT_HYPERLINK,
148148
htmlContent: `<span data-action="HyperlinkEditor" title="${strings.editHyperlink}">
149149
${icons.link}
150150
</span>`

src/extensionsIntegrated/phoenix-pro/browser-context/ruler-lines.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: LicenseRef-Proprietary
44
*/
55

6-
/*global GLOBALS, LivePreviewView, cssStyles, strings, icons*/
6+
/*global GLOBALS, LivePreviewView, cssStyles, strings, icons, proConstants*/
77

88
let _currentRulerLines;
99
let _rulerLinesConfig = { enabled: false };
@@ -252,7 +252,7 @@ function handleRulerLinesConfigChange(oldConfig, newConfig) {
252252
// Dropdown handler: render ruler lines dropdown item
253253
function renderRulerLinesDropdownItems() {
254254
return {
255-
listOrder: 100,
255+
listOrder: proConstants.DROPDOWN_ORDERING.SHOW_MEASUREMENTS,
256256
htmlContent: `<div class="dropdown-item" data-action="toggle-ruler-lines">
257257
<span class="item-icon">${icons.ruler}</span>
258258
<span class="item-label show-ruler-label">${strings.showRulerLines}</span>

src/extensionsIntegrated/phoenix-pro/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ define(function (require, exports, module) {
2525
// constants first
2626
LiveDevProtocol.addRemoteFunctionConstantsScript("strings",
2727
`strings = ${JSON.stringify(remoteConstants.remoteStrings)};`);
28+
LiveDevProtocol.addRemoteFunctionConstantsScript("proConstants",
29+
`proConstants = ${JSON.stringify(remoteConstants.proConstants)};`);
2830
LiveDevProtocol.addRemoteFunctionConstantsScript("icons",
2931
`icons = ${JSON.stringify(remoteIcons.svgIcons)};`);
3032
LiveDevProtocol.addRemoteFunctionConstantsScript("styles",

src/extensionsIntegrated/phoenix-pro/remote-constants.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,26 @@ define(function (require, exports, module) {
4343
toastCopyFirstTime: Strings.LIVE_DEV_COPY_TOAST_MESSAGE,
4444
togglePreviewMode: Strings.LIVE_PREVIEW_MODE_TOGGLE_PREVIEW
4545
};
46+
47+
// this determines the ordering in which the toolbox items appear in the live preview.
48+
const TOOLBOX_ORDERING = {
49+
SELECT_PARENT: 10,
50+
EDIT_TEXT: 20,
51+
EDIT_HYPERLINK: 30,
52+
DUPLICATE: 40,
53+
DELETE: 50,
54+
IMAGE_GALLERY: 60,
55+
MORE_OPTIONS: 70,
56+
AI: 600 // TBD
57+
};
58+
59+
// this determines the ordering in which the toolbox items appear in the live preview.
60+
const DROPDOWN_ORDERING = {
61+
SHOW_MEASUREMENTS: 100
62+
};
63+
64+
exports.proConstants = {
65+
TOOLBOX_ORDERING,
66+
DROPDOWN_ORDERING
67+
};
4668
});

0 commit comments

Comments
 (0)