@wix/site-service-editor-context 1.0.5 → 1.0.7
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/cjs/build/definition/index.d.ts +50 -0
- package/cjs/build/definition/index.js +1 -0
- package/cjs/build/definition/index.js.map +1 -1
- package/cjs/build/types/index.d.ts +1 -0
- package/dist/definition/index.d.ts +50 -0
- package/dist/definition/index.js +1 -0
- package/dist/definition/index.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +2 -2
- package/src/definition/index.ts +50 -0
- package/src/types/index.ts +1 -0
|
@@ -1,15 +1,65 @@
|
|
|
1
1
|
import type { ServiceDefinition } from '@wix/services-definitions';
|
|
2
2
|
import type { EditorName } from '../types';
|
|
3
|
+
/** Values the host supplies when it creates the service. */
|
|
3
4
|
export type IEditorContextServiceConfig = {
|
|
5
|
+
/**
|
|
6
|
+
* Name of the editor associated with the site.
|
|
7
|
+
*
|
|
8
|
+
* Default: `Studio`
|
|
9
|
+
*/
|
|
4
10
|
editorName?: EditorName;
|
|
11
|
+
/**
|
|
12
|
+
* Whether a Wix user is previewing the site in the editor.
|
|
13
|
+
*
|
|
14
|
+
* Default: `false`
|
|
15
|
+
*/
|
|
5
16
|
previewMode?: boolean;
|
|
6
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* Reports whether a Wix user is previewing the site in the editor, and names the editor associated with
|
|
20
|
+
* the site.
|
|
21
|
+
*/
|
|
7
22
|
export interface IEditorContextService {
|
|
23
|
+
/**
|
|
24
|
+
* Name of the editor associated with the site.
|
|
25
|
+
*
|
|
26
|
+
* It has a value on the live site as well as in the editor, so it doesn't tell you whether code is running
|
|
27
|
+
* in an editor. This value doesn't change for the lifetime of the page.
|
|
28
|
+
*
|
|
29
|
+
* Supported values:
|
|
30
|
+
* - `Studio`
|
|
31
|
+
* - `StudioTwo`
|
|
32
|
+
* - `EditorX`
|
|
33
|
+
* - `Odeditor`
|
|
34
|
+
* - `Unknown`
|
|
35
|
+
*
|
|
36
|
+
* The value is `Unknown` when the host can't match the site to a known editor.
|
|
37
|
+
*
|
|
38
|
+
* @exampleValue 'Studio'
|
|
39
|
+
*/
|
|
8
40
|
readonly editorName: EditorName;
|
|
41
|
+
/**
|
|
42
|
+
* Whether a Wix user is previewing the site in the editor.
|
|
43
|
+
*
|
|
44
|
+
* This is `false` while a Wix user edits the site in the editor, as well as on the live site, so
|
|
45
|
+
* `false` doesn't necessarily mean the code is running on the live site.
|
|
46
|
+
*
|
|
47
|
+
* This value can change while the page is open. It changes when the Wix user switches between editing the
|
|
48
|
+
* site and previewing it. Read it while a component renders, so the component updates when it changes.
|
|
49
|
+
*
|
|
50
|
+
* @exampleValue false
|
|
51
|
+
*/
|
|
9
52
|
readonly previewMode: boolean;
|
|
53
|
+
/** @internal Host-only. Replaces config values when the host's state changes. */
|
|
10
54
|
_updateConfig: (config: Partial<IEditorContextServiceConfig>) => void;
|
|
11
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Definition of the Editor Context service, used to resolve it from the services manager.
|
|
58
|
+
*
|
|
59
|
+
* @internal Private service. Documented in the code, but left out of the developer docs.
|
|
60
|
+
*/
|
|
12
61
|
export type IEditorContextDefinition = ServiceDefinition<IEditorContextService, IEditorContextServiceConfig>;
|
|
62
|
+
/** Definition of the Editor Context service. Specify it in `useService()` or `servicesManager.getService()`. */
|
|
13
63
|
export declare const EditorContextDefinition: string & {
|
|
14
64
|
__api: IEditorContextService;
|
|
15
65
|
__config: IEditorContextServiceConfig;
|
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EditorContextDefinition = void 0;
|
|
4
4
|
const services_definitions_1 = require("@wix/services-definitions");
|
|
5
|
+
/** Definition of the Editor Context service. Specify it in `useService()` or `servicesManager.getService()`. */
|
|
5
6
|
exports.EditorContextDefinition = (0, services_definitions_1.defineService)('@wix/site-service-editor-context');
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/definition/index.ts"],"names":[],"mappings":";;;AAAA,oEAAyD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/definition/index.ts"],"names":[],"mappings":";;;AAAA,oEAAyD;AAkEzD,gHAAgH;AACnG,QAAA,uBAAuB,GAAG,IAAA,oCAAa,EACnD,kCAAkC,CAClC,CAAA"}
|
|
@@ -1,15 +1,65 @@
|
|
|
1
1
|
import type { ServiceDefinition } from '@wix/services-definitions';
|
|
2
2
|
import type { EditorName } from '../types';
|
|
3
|
+
/** Values the host supplies when it creates the service. */
|
|
3
4
|
export type IEditorContextServiceConfig = {
|
|
5
|
+
/**
|
|
6
|
+
* Name of the editor associated with the site.
|
|
7
|
+
*
|
|
8
|
+
* Default: `Studio`
|
|
9
|
+
*/
|
|
4
10
|
editorName?: EditorName;
|
|
11
|
+
/**
|
|
12
|
+
* Whether a Wix user is previewing the site in the editor.
|
|
13
|
+
*
|
|
14
|
+
* Default: `false`
|
|
15
|
+
*/
|
|
5
16
|
previewMode?: boolean;
|
|
6
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* Reports whether a Wix user is previewing the site in the editor, and names the editor associated with
|
|
20
|
+
* the site.
|
|
21
|
+
*/
|
|
7
22
|
export interface IEditorContextService {
|
|
23
|
+
/**
|
|
24
|
+
* Name of the editor associated with the site.
|
|
25
|
+
*
|
|
26
|
+
* It has a value on the live site as well as in the editor, so it doesn't tell you whether code is running
|
|
27
|
+
* in an editor. This value doesn't change for the lifetime of the page.
|
|
28
|
+
*
|
|
29
|
+
* Supported values:
|
|
30
|
+
* - `Studio`
|
|
31
|
+
* - `StudioTwo`
|
|
32
|
+
* - `EditorX`
|
|
33
|
+
* - `Odeditor`
|
|
34
|
+
* - `Unknown`
|
|
35
|
+
*
|
|
36
|
+
* The value is `Unknown` when the host can't match the site to a known editor.
|
|
37
|
+
*
|
|
38
|
+
* @exampleValue 'Studio'
|
|
39
|
+
*/
|
|
8
40
|
readonly editorName: EditorName;
|
|
41
|
+
/**
|
|
42
|
+
* Whether a Wix user is previewing the site in the editor.
|
|
43
|
+
*
|
|
44
|
+
* This is `false` while a Wix user edits the site in the editor, as well as on the live site, so
|
|
45
|
+
* `false` doesn't necessarily mean the code is running on the live site.
|
|
46
|
+
*
|
|
47
|
+
* This value can change while the page is open. It changes when the Wix user switches between editing the
|
|
48
|
+
* site and previewing it. Read it while a component renders, so the component updates when it changes.
|
|
49
|
+
*
|
|
50
|
+
* @exampleValue false
|
|
51
|
+
*/
|
|
9
52
|
readonly previewMode: boolean;
|
|
53
|
+
/** @internal Host-only. Replaces config values when the host's state changes. */
|
|
10
54
|
_updateConfig: (config: Partial<IEditorContextServiceConfig>) => void;
|
|
11
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Definition of the Editor Context service, used to resolve it from the services manager.
|
|
58
|
+
*
|
|
59
|
+
* @internal Private service. Documented in the code, but left out of the developer docs.
|
|
60
|
+
*/
|
|
12
61
|
export type IEditorContextDefinition = ServiceDefinition<IEditorContextService, IEditorContextServiceConfig>;
|
|
62
|
+
/** Definition of the Editor Context service. Specify it in `useService()` or `servicesManager.getService()`. */
|
|
13
63
|
export declare const EditorContextDefinition: string & {
|
|
14
64
|
__api: IEditorContextService;
|
|
15
65
|
__config: IEditorContextServiceConfig;
|
package/dist/definition/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { defineService } from '@wix/services-definitions';
|
|
2
|
+
/** Definition of the Editor Context service. Specify it in `useService()` or `servicesManager.getService()`. */
|
|
2
3
|
export const EditorContextDefinition = defineService('@wix/site-service-editor-context');
|
|
3
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/definition/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/definition/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAkEzD,gHAAgH;AAChH,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CACnD,kCAAkC,CAClC,CAAA"}
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/site-service-editor-context",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
]
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
|
-
"falconPackageHash": "
|
|
80
|
+
"falconPackageHash": "7046e5e4391704fe3befe0e49eb23032b647f8d0ce998cacf68dd57b"
|
|
81
81
|
}
|
package/src/definition/index.ts
CHANGED
|
@@ -2,19 +2,69 @@ import { defineService } from '@wix/services-definitions'
|
|
|
2
2
|
import type { ServiceDefinition } from '@wix/services-definitions'
|
|
3
3
|
import type { EditorName } from '../types'
|
|
4
4
|
|
|
5
|
+
/** Values the host supplies when it creates the service. */
|
|
5
6
|
export type IEditorContextServiceConfig = {
|
|
7
|
+
/**
|
|
8
|
+
* Name of the editor associated with the site.
|
|
9
|
+
*
|
|
10
|
+
* Default: `Studio`
|
|
11
|
+
*/
|
|
6
12
|
editorName?: EditorName
|
|
13
|
+
/**
|
|
14
|
+
* Whether a Wix user is previewing the site in the editor.
|
|
15
|
+
*
|
|
16
|
+
* Default: `false`
|
|
17
|
+
*/
|
|
7
18
|
previewMode?: boolean
|
|
8
19
|
}
|
|
9
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Reports whether a Wix user is previewing the site in the editor, and names the editor associated with
|
|
23
|
+
* the site.
|
|
24
|
+
*/
|
|
10
25
|
export interface IEditorContextService {
|
|
26
|
+
/**
|
|
27
|
+
* Name of the editor associated with the site.
|
|
28
|
+
*
|
|
29
|
+
* It has a value on the live site as well as in the editor, so it doesn't tell you whether code is running
|
|
30
|
+
* in an editor. This value doesn't change for the lifetime of the page.
|
|
31
|
+
*
|
|
32
|
+
* Supported values:
|
|
33
|
+
* - `Studio`
|
|
34
|
+
* - `StudioTwo`
|
|
35
|
+
* - `EditorX`
|
|
36
|
+
* - `Odeditor`
|
|
37
|
+
* - `Unknown`
|
|
38
|
+
*
|
|
39
|
+
* The value is `Unknown` when the host can't match the site to a known editor.
|
|
40
|
+
*
|
|
41
|
+
* @exampleValue 'Studio'
|
|
42
|
+
*/
|
|
11
43
|
readonly editorName: EditorName
|
|
44
|
+
/**
|
|
45
|
+
* Whether a Wix user is previewing the site in the editor.
|
|
46
|
+
*
|
|
47
|
+
* This is `false` while a Wix user edits the site in the editor, as well as on the live site, so
|
|
48
|
+
* `false` doesn't necessarily mean the code is running on the live site.
|
|
49
|
+
*
|
|
50
|
+
* This value can change while the page is open. It changes when the Wix user switches between editing the
|
|
51
|
+
* site and previewing it. Read it while a component renders, so the component updates when it changes.
|
|
52
|
+
*
|
|
53
|
+
* @exampleValue false
|
|
54
|
+
*/
|
|
12
55
|
readonly previewMode: boolean
|
|
56
|
+
/** @internal Host-only. Replaces config values when the host's state changes. */
|
|
13
57
|
_updateConfig: (config: Partial<IEditorContextServiceConfig>) => void
|
|
14
58
|
}
|
|
15
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Definition of the Editor Context service, used to resolve it from the services manager.
|
|
62
|
+
*
|
|
63
|
+
* @internal Private service. Documented in the code, but left out of the developer docs.
|
|
64
|
+
*/
|
|
16
65
|
export type IEditorContextDefinition = ServiceDefinition<IEditorContextService, IEditorContextServiceConfig>
|
|
17
66
|
|
|
67
|
+
/** Definition of the Editor Context service. Specify it in `useService()` or `servicesManager.getService()`. */
|
|
18
68
|
export const EditorContextDefinition = defineService<IEditorContextService, IEditorContextServiceConfig>(
|
|
19
69
|
'@wix/site-service-editor-context'
|
|
20
70
|
)
|
package/src/types/index.ts
CHANGED