PluginProbe
Tableberg – Simple Gutenberg Table Block / 1.1.5
Tableberg – Simple Gutenberg Table Block v1.1.5
1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.5 1.0.4 1.0.3 1.0.2 1.0.1 trunk 0.0.2 0.2.1 0.3.2 0.3.3 0.4.1 0.5.0 0.5.1 0.5.2 0.5.3 0.5.4 0.5.5 0.5.6 0.5.7 All 42 releases
tableberg / src / pro-status.ts

pro-status.ts in Tableberg – Simple Gutenberg Table Block 1.1.5, at src/pro-status.ts

41 lines 948 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 type TablebergConfig = {
2 plugin_url?: string;
3 IS_PRO?: boolean;
4 };
5
6 export function getTablebergConfig(): TablebergConfig {
7 if (typeof globalThis !== "undefined") {
8 const globalConfig = (
9 globalThis as typeof globalThis & {
10 TABLEBERG_CFG?: TablebergConfig;
11 }
12 ).TABLEBERG_CFG;
13
14 if (globalConfig) {
15 return globalConfig;
16 }
17 }
18
19 if (typeof window !== "undefined") {
20 try {
21 const parentConfig = (
22 window.parent as Window & {
23 TABLEBERG_CFG?: TablebergConfig;
24 }
25 )?.TABLEBERG_CFG;
26
27 if (parentConfig) {
28 return parentConfig;
29 }
30 } catch {
31 // Cross-frame access can fail; fall back to defaults.
32 }
33 }
34
35 return {};
36 }
37
38 export function isProAvailable() {
39 return Boolean(getTablebergConfig().IS_PRO);
40 }
41