@elementor/editor-elements-panel-notice 4.0.0-633
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/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +86 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +49 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +53 -0
- package/src/components/notice-portal.tsx +20 -0
- package/src/index.ts +1 -0
- package/src/init.tsx +27 -0
- package/src/utils/create-notice-view.ts +5 -0
package/dist/index.d.mts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
register: () => register
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(index_exports);
|
|
36
|
+
|
|
37
|
+
// src/init.tsx
|
|
38
|
+
var React2 = __toESM(require("react"));
|
|
39
|
+
var import_editor = require("@elementor/editor");
|
|
40
|
+
var import_editor_v1_adapters2 = require("@elementor/editor-v1-adapters");
|
|
41
|
+
|
|
42
|
+
// src/components/notice-portal.tsx
|
|
43
|
+
var React = __toESM(require("react"));
|
|
44
|
+
var import_editor_v1_adapters = require("@elementor/editor-v1-adapters");
|
|
45
|
+
var import_ui = require("@elementor/ui");
|
|
46
|
+
var NOTICE_AREA_ID = "elementor-panel-elements-notice-area";
|
|
47
|
+
var ELEMENTS_PANEL_ROUTE_PREFIX = "panel/elements/";
|
|
48
|
+
function NoticePortal({ component: Component }) {
|
|
49
|
+
const container = (0, import_editor_v1_adapters.__privateUseListenTo)(
|
|
50
|
+
[(0, import_editor_v1_adapters.v1ReadyEvent)(), (0, import_editor_v1_adapters.routeOpenEvent)(ELEMENTS_PANEL_ROUTE_PREFIX)],
|
|
51
|
+
() => document.getElementById(NOTICE_AREA_ID)
|
|
52
|
+
);
|
|
53
|
+
return container ? /* @__PURE__ */ React.createElement(import_ui.Portal, { container }, /* @__PURE__ */ React.createElement(Component, null)) : null;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// src/utils/create-notice-view.ts
|
|
57
|
+
function createNoticeView() {
|
|
58
|
+
return window.Marionette?.CompositeView.extend({
|
|
59
|
+
template: `<div></div>`
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// src/init.tsx
|
|
64
|
+
function register(Component) {
|
|
65
|
+
(0, import_editor.injectIntoTop)({
|
|
66
|
+
id: "editor-elements-panel-notice",
|
|
67
|
+
component: () => /* @__PURE__ */ React2.createElement(NoticePortal, { component: Component })
|
|
68
|
+
});
|
|
69
|
+
(0, import_editor_v1_adapters2.__privateListenTo)((0, import_editor_v1_adapters2.v1ReadyEvent)(), () => {
|
|
70
|
+
window.elementor?.hooks?.addFilter(
|
|
71
|
+
"panel/elements/regionViews",
|
|
72
|
+
(regionViews, { notice }) => {
|
|
73
|
+
regionViews.notice = {
|
|
74
|
+
region: notice,
|
|
75
|
+
view: createNoticeView()
|
|
76
|
+
};
|
|
77
|
+
return regionViews;
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
83
|
+
0 && (module.exports = {
|
|
84
|
+
register
|
|
85
|
+
});
|
|
86
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/init.tsx","../src/components/notice-portal.tsx","../src/utils/create-notice-view.ts"],"sourcesContent":["export { register } from './init';\n","import * as React from 'react';\nimport { injectIntoTop } from '@elementor/editor';\nimport { __privateListenTo as listenTo, v1ReadyEvent } from '@elementor/editor-v1-adapters';\n\nimport { NoticePortal } from './components/notice-portal';\nimport { createNoticeView } from './utils/create-notice-view';\n\nexport function register( Component: React.ComponentType ) {\n\tinjectIntoTop( {\n\t\tid: 'editor-elements-panel-notice',\n\t\tcomponent: () => <NoticePortal component={ Component } />,\n\t} );\n\n\tlistenTo( v1ReadyEvent(), () => {\n\t\twindow.elementor?.hooks?.addFilter(\n\t\t\t'panel/elements/regionViews',\n\t\t\t( regionViews, { notice }: Record< string, unknown > ) => {\n\t\t\t\tregionViews.notice = {\n\t\t\t\t\tregion: notice,\n\t\t\t\t\tview: createNoticeView(),\n\t\t\t\t};\n\n\t\t\t\treturn regionViews;\n\t\t\t}\n\t\t);\n\t} );\n}\n","import * as React from 'react';\nimport { __privateUseListenTo as useListenTo, routeOpenEvent, v1ReadyEvent } from '@elementor/editor-v1-adapters';\nimport { Portal } from '@elementor/ui';\n\nconst NOTICE_AREA_ID = 'elementor-panel-elements-notice-area';\nconst ELEMENTS_PANEL_ROUTE_PREFIX = 'panel/elements/';\n\ntype Props = { component: React.ComponentType };\n\nexport function NoticePortal( { component: Component }: Props ) {\n\tconst container = useListenTo( [ v1ReadyEvent(), routeOpenEvent( ELEMENTS_PANEL_ROUTE_PREFIX ) ], () =>\n\t\tdocument.getElementById( NOTICE_AREA_ID )\n\t);\n\n\treturn container ? (\n\t\t<Portal container={ container }>\n\t\t\t<Component />\n\t\t</Portal>\n\t) : null;\n}\n","export function createNoticeView() {\n\treturn window.Marionette?.CompositeView.extend( {\n\t\ttemplate: `<div></div>`,\n\t} );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,SAAuB;AACvB,oBAA8B;AAC9B,IAAAC,6BAA4D;;;ACF5D,YAAuB;AACvB,gCAAkF;AAClF,gBAAuB;AAEvB,IAAM,iBAAiB;AACvB,IAAM,8BAA8B;AAI7B,SAAS,aAAc,EAAE,WAAW,UAAU,GAAW;AAC/D,QAAM,gBAAY,0BAAAC;AAAA,IAAa,KAAE,wCAAa,OAAG,0CAAgB,2BAA4B,CAAE;AAAA,IAAG,MACjG,SAAS,eAAgB,cAAe;AAAA,EACzC;AAEA,SAAO,YACN,oCAAC,oBAAO,aACP,oCAAC,eAAU,CACZ,IACG;AACL;;;ACnBO,SAAS,mBAAmB;AAClC,SAAO,OAAO,YAAY,cAAc,OAAQ;AAAA,IAC/C,UAAU;AAAA,EACX,CAAE;AACH;;;AFGO,SAAS,SAAU,WAAiC;AAC1D,mCAAe;AAAA,IACd,IAAI;AAAA,IACJ,WAAW,MAAM,qCAAC,gBAAa,WAAY,WAAY;AAAA,EACxD,CAAE;AAEF,iCAAAC,uBAAU,yCAAa,GAAG,MAAM;AAC/B,WAAO,WAAW,OAAO;AAAA,MACxB;AAAA,MACA,CAAE,aAAa,EAAE,OAAO,MAAkC;AACzD,oBAAY,SAAS;AAAA,UACpB,QAAQ;AAAA,UACR,MAAM,iBAAiB;AAAA,QACxB;AAEA,eAAO;AAAA,MACR;AAAA,IACD;AAAA,EACD,CAAE;AACH;","names":["React","import_editor_v1_adapters","useListenTo","listenTo"]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// src/init.tsx
|
|
2
|
+
import * as React2 from "react";
|
|
3
|
+
import { injectIntoTop } from "@elementor/editor";
|
|
4
|
+
import { __privateListenTo as listenTo, v1ReadyEvent as v1ReadyEvent2 } from "@elementor/editor-v1-adapters";
|
|
5
|
+
|
|
6
|
+
// src/components/notice-portal.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { __privateUseListenTo as useListenTo, routeOpenEvent, v1ReadyEvent } from "@elementor/editor-v1-adapters";
|
|
9
|
+
import { Portal } from "@elementor/ui";
|
|
10
|
+
var NOTICE_AREA_ID = "elementor-panel-elements-notice-area";
|
|
11
|
+
var ELEMENTS_PANEL_ROUTE_PREFIX = "panel/elements/";
|
|
12
|
+
function NoticePortal({ component: Component }) {
|
|
13
|
+
const container = useListenTo(
|
|
14
|
+
[v1ReadyEvent(), routeOpenEvent(ELEMENTS_PANEL_ROUTE_PREFIX)],
|
|
15
|
+
() => document.getElementById(NOTICE_AREA_ID)
|
|
16
|
+
);
|
|
17
|
+
return container ? /* @__PURE__ */ React.createElement(Portal, { container }, /* @__PURE__ */ React.createElement(Component, null)) : null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// src/utils/create-notice-view.ts
|
|
21
|
+
function createNoticeView() {
|
|
22
|
+
return window.Marionette?.CompositeView.extend({
|
|
23
|
+
template: `<div></div>`
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// src/init.tsx
|
|
28
|
+
function register(Component) {
|
|
29
|
+
injectIntoTop({
|
|
30
|
+
id: "editor-elements-panel-notice",
|
|
31
|
+
component: () => /* @__PURE__ */ React2.createElement(NoticePortal, { component: Component })
|
|
32
|
+
});
|
|
33
|
+
listenTo(v1ReadyEvent2(), () => {
|
|
34
|
+
window.elementor?.hooks?.addFilter(
|
|
35
|
+
"panel/elements/regionViews",
|
|
36
|
+
(regionViews, { notice }) => {
|
|
37
|
+
regionViews.notice = {
|
|
38
|
+
region: notice,
|
|
39
|
+
view: createNoticeView()
|
|
40
|
+
};
|
|
41
|
+
return regionViews;
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
register
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/init.tsx","../src/components/notice-portal.tsx","../src/utils/create-notice-view.ts"],"sourcesContent":["import * as React from 'react';\nimport { injectIntoTop } from '@elementor/editor';\nimport { __privateListenTo as listenTo, v1ReadyEvent } from '@elementor/editor-v1-adapters';\n\nimport { NoticePortal } from './components/notice-portal';\nimport { createNoticeView } from './utils/create-notice-view';\n\nexport function register( Component: React.ComponentType ) {\n\tinjectIntoTop( {\n\t\tid: 'editor-elements-panel-notice',\n\t\tcomponent: () => <NoticePortal component={ Component } />,\n\t} );\n\n\tlistenTo( v1ReadyEvent(), () => {\n\t\twindow.elementor?.hooks?.addFilter(\n\t\t\t'panel/elements/regionViews',\n\t\t\t( regionViews, { notice }: Record< string, unknown > ) => {\n\t\t\t\tregionViews.notice = {\n\t\t\t\t\tregion: notice,\n\t\t\t\t\tview: createNoticeView(),\n\t\t\t\t};\n\n\t\t\t\treturn regionViews;\n\t\t\t}\n\t\t);\n\t} );\n}\n","import * as React from 'react';\nimport { __privateUseListenTo as useListenTo, routeOpenEvent, v1ReadyEvent } from '@elementor/editor-v1-adapters';\nimport { Portal } from '@elementor/ui';\n\nconst NOTICE_AREA_ID = 'elementor-panel-elements-notice-area';\nconst ELEMENTS_PANEL_ROUTE_PREFIX = 'panel/elements/';\n\ntype Props = { component: React.ComponentType };\n\nexport function NoticePortal( { component: Component }: Props ) {\n\tconst container = useListenTo( [ v1ReadyEvent(), routeOpenEvent( ELEMENTS_PANEL_ROUTE_PREFIX ) ], () =>\n\t\tdocument.getElementById( NOTICE_AREA_ID )\n\t);\n\n\treturn container ? (\n\t\t<Portal container={ container }>\n\t\t\t<Component />\n\t\t</Portal>\n\t) : null;\n}\n","export function createNoticeView() {\n\treturn window.Marionette?.CompositeView.extend( {\n\t\ttemplate: `<div></div>`,\n\t} );\n}\n"],"mappings":";AAAA,YAAYA,YAAW;AACvB,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB,UAAU,gBAAAC,qBAAoB;;;ACF5D,YAAY,WAAW;AACvB,SAAS,wBAAwB,aAAa,gBAAgB,oBAAoB;AAClF,SAAS,cAAc;AAEvB,IAAM,iBAAiB;AACvB,IAAM,8BAA8B;AAI7B,SAAS,aAAc,EAAE,WAAW,UAAU,GAAW;AAC/D,QAAM,YAAY;AAAA,IAAa,CAAE,aAAa,GAAG,eAAgB,2BAA4B,CAAE;AAAA,IAAG,MACjG,SAAS,eAAgB,cAAe;AAAA,EACzC;AAEA,SAAO,YACN,oCAAC,UAAO,aACP,oCAAC,eAAU,CACZ,IACG;AACL;;;ACnBO,SAAS,mBAAmB;AAClC,SAAO,OAAO,YAAY,cAAc,OAAQ;AAAA,IAC/C,UAAU;AAAA,EACX,CAAE;AACH;;;AFGO,SAAS,SAAU,WAAiC;AAC1D,gBAAe;AAAA,IACd,IAAI;AAAA,IACJ,WAAW,MAAM,qCAAC,gBAAa,WAAY,WAAY;AAAA,EACxD,CAAE;AAEF,WAAUC,cAAa,GAAG,MAAM;AAC/B,WAAO,WAAW,OAAO;AAAA,MACxB;AAAA,MACA,CAAE,aAAa,EAAE,OAAO,MAAkC;AACzD,oBAAY,SAAS;AAAA,UACpB,QAAQ;AAAA,UACR,MAAM,iBAAiB;AAAA,QACxB;AAEA,eAAO;AAAA,MACR;AAAA,IACD;AAAA,EACD,CAAE;AACH;","names":["React","v1ReadyEvent","v1ReadyEvent"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elementor/editor-elements-panel-notice",
|
|
3
|
+
"version": "4.0.0-633",
|
|
4
|
+
"private": false,
|
|
5
|
+
"author": "Elementor Team",
|
|
6
|
+
"homepage": "https://elementor.com/",
|
|
7
|
+
"license": "GPL-3.0-or-later",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"module": "dist/index.mjs",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.mjs",
|
|
15
|
+
"require": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./package.json": "./package.json"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/elementor/elementor.git",
|
|
22
|
+
"directory": "packages/core/editor-elements-panel-notice"
|
|
23
|
+
},
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/elementor/elementor/issues"
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"README.md",
|
|
32
|
+
"CHANGELOG.md",
|
|
33
|
+
"/dist",
|
|
34
|
+
"/src",
|
|
35
|
+
"!**/__tests__"
|
|
36
|
+
],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsup --config=../../tsup.build.ts",
|
|
39
|
+
"dev": "tsup --config=../../tsup.dev.ts"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@elementor/ui": "1.36.17",
|
|
43
|
+
"@elementor/editor": "4.0.0-633",
|
|
44
|
+
"@elementor/editor-v1-adapters": "4.0.0-633"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"react": "^18.3.1",
|
|
48
|
+
"react-dom": "^18.3.1"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"tsup": "^8.3.5"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { __privateUseListenTo as useListenTo, routeOpenEvent, v1ReadyEvent } from '@elementor/editor-v1-adapters';
|
|
3
|
+
import { Portal } from '@elementor/ui';
|
|
4
|
+
|
|
5
|
+
const NOTICE_AREA_ID = 'elementor-panel-elements-notice-area';
|
|
6
|
+
const ELEMENTS_PANEL_ROUTE_PREFIX = 'panel/elements/';
|
|
7
|
+
|
|
8
|
+
type Props = { component: React.ComponentType };
|
|
9
|
+
|
|
10
|
+
export function NoticePortal( { component: Component }: Props ) {
|
|
11
|
+
const container = useListenTo( [ v1ReadyEvent(), routeOpenEvent( ELEMENTS_PANEL_ROUTE_PREFIX ) ], () =>
|
|
12
|
+
document.getElementById( NOTICE_AREA_ID )
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
return container ? (
|
|
16
|
+
<Portal container={ container }>
|
|
17
|
+
<Component />
|
|
18
|
+
</Portal>
|
|
19
|
+
) : null;
|
|
20
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { register } from './init';
|
package/src/init.tsx
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { injectIntoTop } from '@elementor/editor';
|
|
3
|
+
import { __privateListenTo as listenTo, v1ReadyEvent } from '@elementor/editor-v1-adapters';
|
|
4
|
+
|
|
5
|
+
import { NoticePortal } from './components/notice-portal';
|
|
6
|
+
import { createNoticeView } from './utils/create-notice-view';
|
|
7
|
+
|
|
8
|
+
export function register( Component: React.ComponentType ) {
|
|
9
|
+
injectIntoTop( {
|
|
10
|
+
id: 'editor-elements-panel-notice',
|
|
11
|
+
component: () => <NoticePortal component={ Component } />,
|
|
12
|
+
} );
|
|
13
|
+
|
|
14
|
+
listenTo( v1ReadyEvent(), () => {
|
|
15
|
+
window.elementor?.hooks?.addFilter(
|
|
16
|
+
'panel/elements/regionViews',
|
|
17
|
+
( regionViews, { notice }: Record< string, unknown > ) => {
|
|
18
|
+
regionViews.notice = {
|
|
19
|
+
region: notice,
|
|
20
|
+
view: createNoticeView(),
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return regionViews;
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
} );
|
|
27
|
+
}
|