@xwiki/cristal-uiextension-api 1.3.0 → 1.4.0
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/package.json +2 -2
- package/dist/index.d.cts +0 -69
- package/dist/index.d.ts +0 -69
- package/dist/index.es.js +0 -24
- package/dist/index.es.js.map +0 -1
- package/dist/index.umd.js +0 -2
- package/dist/index.umd.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xwiki/cristal-uiextension-api",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"license": "LGPL 2.1",
|
|
5
5
|
"author": "XWiki Org Community <contact@xwiki.org>",
|
|
6
6
|
"homepage": "https://cristal.xwiki.org/",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"typescript": "5.9.3",
|
|
42
42
|
"vite": "7.3.2",
|
|
43
43
|
"vue": "3.5.30",
|
|
44
|
-
"@xwiki/cristal-dev-config": "1.
|
|
44
|
+
"@xwiki/cristal-dev-config": "1.4.0"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"api-extractor:local": "api-extractor run --local",
|
package/dist/index.d.cts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { Component } from 'vue';
|
|
2
|
-
import { ComposerTranslation } from 'vue-i18n';
|
|
3
|
-
/**
|
|
4
|
-
* Define the information held by a UI Extension (UIX).
|
|
5
|
-
*
|
|
6
|
-
* @since 0.11
|
|
7
|
-
* @beta
|
|
8
|
-
*/
|
|
9
|
-
interface UIExtension {
|
|
10
|
-
/**
|
|
11
|
-
* The unique id of an UI Extension
|
|
12
|
-
*/
|
|
13
|
-
id: string;
|
|
14
|
-
/**
|
|
15
|
-
* The id of the extension point where this UIX should be injected.
|
|
16
|
-
*/
|
|
17
|
-
uixpName: string;
|
|
18
|
-
/**
|
|
19
|
-
* The order of the UIX. The lowest values are expected to be presented
|
|
20
|
-
* first.
|
|
21
|
-
*/
|
|
22
|
-
order: number;
|
|
23
|
-
/**
|
|
24
|
-
* A free set of parameters.
|
|
25
|
-
*/
|
|
26
|
-
parameters: {
|
|
27
|
-
[key: string]: unknown;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Compute if the UIX should be displayed.
|
|
31
|
-
*/
|
|
32
|
-
enabled(): Promise<boolean>;
|
|
33
|
-
/**
|
|
34
|
-
* The UI component of the UIX.
|
|
35
|
-
*/
|
|
36
|
-
component(): Promise<Component>;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* @since 0.11
|
|
40
|
-
* @beta
|
|
41
|
-
*/
|
|
42
|
-
interface UIExtensionsManager {
|
|
43
|
-
/**
|
|
44
|
-
*
|
|
45
|
-
* @param name - the name of the UIXP
|
|
46
|
-
* @returns a list of UIExtension components, sorted by ascending order. disabled UIExtensions are excluded
|
|
47
|
-
*/
|
|
48
|
-
list(name: string): Promise<UIExtension[]>;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Abstract class helping with localization of UI extensions.
|
|
52
|
-
*
|
|
53
|
-
* @since 0.23
|
|
54
|
-
* @beta
|
|
55
|
-
*/
|
|
56
|
-
declare abstract class AbstractUIExtension implements UIExtension {
|
|
57
|
-
protected t: ComposerTranslation;
|
|
58
|
-
constructor(messages: Record<string, Record<string, string>>);
|
|
59
|
-
abstract id: string;
|
|
60
|
-
abstract uixpName: string;
|
|
61
|
-
abstract order: number;
|
|
62
|
-
abstract parameters: {
|
|
63
|
-
[key: string]: unknown;
|
|
64
|
-
};
|
|
65
|
-
abstract enabled(): Promise<boolean>;
|
|
66
|
-
abstract component(): Promise<Component>;
|
|
67
|
-
}
|
|
68
|
-
export { AbstractUIExtension };
|
|
69
|
-
export type { UIExtension, UIExtensionsManager };
|
package/dist/index.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { Component } from 'vue';
|
|
2
|
-
import { ComposerTranslation } from 'vue-i18n';
|
|
3
|
-
/**
|
|
4
|
-
* Define the information held by a UI Extension (UIX).
|
|
5
|
-
*
|
|
6
|
-
* @since 0.11
|
|
7
|
-
* @beta
|
|
8
|
-
*/
|
|
9
|
-
interface UIExtension {
|
|
10
|
-
/**
|
|
11
|
-
* The unique id of an UI Extension
|
|
12
|
-
*/
|
|
13
|
-
id: string;
|
|
14
|
-
/**
|
|
15
|
-
* The id of the extension point where this UIX should be injected.
|
|
16
|
-
*/
|
|
17
|
-
uixpName: string;
|
|
18
|
-
/**
|
|
19
|
-
* The order of the UIX. The lowest values are expected to be presented
|
|
20
|
-
* first.
|
|
21
|
-
*/
|
|
22
|
-
order: number;
|
|
23
|
-
/**
|
|
24
|
-
* A free set of parameters.
|
|
25
|
-
*/
|
|
26
|
-
parameters: {
|
|
27
|
-
[key: string]: unknown;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Compute if the UIX should be displayed.
|
|
31
|
-
*/
|
|
32
|
-
enabled(): Promise<boolean>;
|
|
33
|
-
/**
|
|
34
|
-
* The UI component of the UIX.
|
|
35
|
-
*/
|
|
36
|
-
component(): Promise<Component>;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* @since 0.11
|
|
40
|
-
* @beta
|
|
41
|
-
*/
|
|
42
|
-
interface UIExtensionsManager {
|
|
43
|
-
/**
|
|
44
|
-
*
|
|
45
|
-
* @param name - the name of the UIXP
|
|
46
|
-
* @returns a list of UIExtension components, sorted by ascending order. disabled UIExtensions are excluded
|
|
47
|
-
*/
|
|
48
|
-
list(name: string): Promise<UIExtension[]>;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Abstract class helping with localization of UI extensions.
|
|
52
|
-
*
|
|
53
|
-
* @since 0.23
|
|
54
|
-
* @beta
|
|
55
|
-
*/
|
|
56
|
-
declare abstract class AbstractUIExtension implements UIExtension {
|
|
57
|
-
protected t: ComposerTranslation;
|
|
58
|
-
constructor(messages: Record<string, Record<string, string>>);
|
|
59
|
-
abstract id: string;
|
|
60
|
-
abstract uixpName: string;
|
|
61
|
-
abstract order: number;
|
|
62
|
-
abstract parameters: {
|
|
63
|
-
[key: string]: unknown;
|
|
64
|
-
};
|
|
65
|
-
abstract enabled(): Promise<boolean>;
|
|
66
|
-
abstract component(): Promise<Component>;
|
|
67
|
-
}
|
|
68
|
-
export { AbstractUIExtension };
|
|
69
|
-
export type { UIExtension, UIExtensionsManager };
|
package/dist/index.es.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { injectable as l, unmanaged as m } from "inversify";
|
|
2
|
-
import { useI18n as i } from "vue-i18n";
|
|
3
|
-
var p = Object.getOwnPropertyDescriptor, v = (e, t, o, r) => {
|
|
4
|
-
for (var s = r > 1 ? void 0 : r ? p(t, o) : t, a = e.length - 1, n; a >= 0; a--)
|
|
5
|
-
(n = e[a]) && (s = n(s) || s);
|
|
6
|
-
return s;
|
|
7
|
-
}, _ = (e, t) => (o, r) => t(o, r, e);
|
|
8
|
-
let c = class {
|
|
9
|
-
t;
|
|
10
|
-
constructor(e) {
|
|
11
|
-
const { t, mergeLocaleMessage: o } = i();
|
|
12
|
-
for (const r in e)
|
|
13
|
-
o(r, e[r]);
|
|
14
|
-
this.t = t;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
c = v([
|
|
18
|
-
l(),
|
|
19
|
-
_(0, m())
|
|
20
|
-
], c);
|
|
21
|
-
export {
|
|
22
|
-
c as AbstractUIExtension
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=index.es.js.map
|
package/dist/index.es.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../src/index.ts"],"sourcesContent":["/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport { injectable, unmanaged } from \"inversify\";\nimport { useI18n } from \"vue-i18n\";\nimport type { Component } from \"vue\";\nimport type { ComposerTranslation } from \"vue-i18n\";\n\n/**\n * Define the information held by a UI Extension (UIX).\n *\n * @since 0.11\n * @beta\n */\ninterface UIExtension {\n /**\n * The unique id of an UI Extension\n */\n id: string;\n\n /**\n * The id of the extension point where this UIX should be injected.\n */\n uixpName: string;\n\n /**\n * The order of the UIX. The lowest values are expected to be presented\n * first.\n */\n order: number;\n\n /**\n * A free set of parameters.\n */\n parameters: { [key: string]: unknown };\n\n /**\n * Compute if the UIX should be displayed.\n */\n enabled(): Promise<boolean>;\n\n /**\n * The UI component of the UIX.\n */\n component(): Promise<Component>;\n}\n\n/**\n * @since 0.11\n * @beta\n */\ninterface UIExtensionsManager {\n /**\n *\n * @param name - the name of the UIXP\n * @returns a list of UIExtension components, sorted by ascending order. disabled UIExtensions are excluded\n */\n list(name: string): Promise<UIExtension[]>;\n}\n\n/**\n * Abstract class helping with localization of UI extensions.\n *\n * @since 0.23\n * @beta\n */\n@injectable()\nabstract class AbstractUIExtension implements UIExtension {\n protected t: ComposerTranslation;\n\n constructor(@unmanaged() messages: Record<string, Record<string, string>>) {\n const { t, mergeLocaleMessage } = useI18n();\n for (const messagesKey in messages) {\n mergeLocaleMessage(messagesKey, messages[messagesKey]);\n }\n this.t = t;\n }\n\n abstract id: string;\n abstract uixpName: string;\n abstract order: number;\n abstract parameters: { [key: string]: unknown };\n\n abstract enabled(): Promise<boolean>;\n abstract component(): Promise<Component>;\n}\n\nexport { AbstractUIExtension };\nexport type { UIExtension, UIExtensionsManager };\n"],"names":["AbstractUIExtension","messages","mergeLocaleMessage","useI18n","messagesKey","__decorateClass","injectable","__decorateParam","unmanaged"],"mappings":";;;;;;;AAoFA,IAAeA,IAAf,MAA0D;AAAA,EAC9C;AAAA,EAEV,YAAyBC,GAAkD;AACzE,UAAM,EAAE,GAAG,oBAAAC,EAAA,IAAuBC,EAAA;AAClC,eAAWC,KAAeH;AACxB,MAAAC,EAAmBE,GAAaH,EAASG,CAAW,CAAC;AAEvD,SAAK,IAAI;AAAA,EACX;AASF;AAlBeJ,IAAfK,EAAA;AAAA,EADCC,EAAA;AAAA,EAIcC,EAAA,GAAAC,EAAA,CAAU;AAAA,GAHVR,CAAA;"}
|
package/dist/index.umd.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(function(e,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("inversify"),require("vue-i18n")):typeof define=="function"&&define.amd?define(["exports","inversify","vue-i18n"],i):(e=typeof globalThis<"u"?globalThis:e||self,i(e["cristal_uiextension-api"]={},e.inversify,e.vueI18n))})(this,(function(e,i,a){"use strict";var f=Object.getOwnPropertyDescriptor,d=(r,t,o,s)=>{for(var n=s>1?void 0:s?f(t,o):t,u=r.length-1,c;u>=0;u--)(c=r[u])&&(n=c(n)||n);return n},v=(r,t)=>(o,s)=>t(o,s,r);e.AbstractUIExtension=class{t;constructor(t){const{t:o,mergeLocaleMessage:s}=a.useI18n();for(const n in t)s(n,t[n]);this.t=o}},e.AbstractUIExtension=d([i.injectable(),v(0,i.unmanaged())],e.AbstractUIExtension),Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
|
|
2
|
-
//# sourceMappingURL=index.umd.js.map
|
package/dist/index.umd.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":["../src/index.ts"],"sourcesContent":["/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport { injectable, unmanaged } from \"inversify\";\nimport { useI18n } from \"vue-i18n\";\nimport type { Component } from \"vue\";\nimport type { ComposerTranslation } from \"vue-i18n\";\n\n/**\n * Define the information held by a UI Extension (UIX).\n *\n * @since 0.11\n * @beta\n */\ninterface UIExtension {\n /**\n * The unique id of an UI Extension\n */\n id: string;\n\n /**\n * The id of the extension point where this UIX should be injected.\n */\n uixpName: string;\n\n /**\n * The order of the UIX. The lowest values are expected to be presented\n * first.\n */\n order: number;\n\n /**\n * A free set of parameters.\n */\n parameters: { [key: string]: unknown };\n\n /**\n * Compute if the UIX should be displayed.\n */\n enabled(): Promise<boolean>;\n\n /**\n * The UI component of the UIX.\n */\n component(): Promise<Component>;\n}\n\n/**\n * @since 0.11\n * @beta\n */\ninterface UIExtensionsManager {\n /**\n *\n * @param name - the name of the UIXP\n * @returns a list of UIExtension components, sorted by ascending order. disabled UIExtensions are excluded\n */\n list(name: string): Promise<UIExtension[]>;\n}\n\n/**\n * Abstract class helping with localization of UI extensions.\n *\n * @since 0.23\n * @beta\n */\n@injectable()\nabstract class AbstractUIExtension implements UIExtension {\n protected t: ComposerTranslation;\n\n constructor(@unmanaged() messages: Record<string, Record<string, string>>) {\n const { t, mergeLocaleMessage } = useI18n();\n for (const messagesKey in messages) {\n mergeLocaleMessage(messagesKey, messages[messagesKey]);\n }\n this.t = t;\n }\n\n abstract id: string;\n abstract uixpName: string;\n abstract order: number;\n abstract parameters: { [key: string]: unknown };\n\n abstract enabled(): Promise<boolean>;\n abstract component(): Promise<Component>;\n}\n\nexport { AbstractUIExtension };\nexport type { UIExtension, UIExtensionsManager };\n"],"names":["AbstractUIExtension","messages","t","mergeLocaleMessage","useI18n","messagesKey","__decorateClass","injectable","__decorateParam","unmanaged"],"mappings":"kfAoFeA,EAAAA,oBAAf,KAA0D,CAC9C,EAEV,YAAyBC,EAAkD,CACzE,KAAM,CAAE,EAAAC,EAAG,mBAAAC,CAAA,EAAuBC,UAAA,EAClC,UAAWC,KAAeJ,EACxBE,EAAmBE,EAAaJ,EAASI,CAAW,CAAC,EAEvD,KAAK,EAAIH,CACX,CASF,EAlBeF,EAAAA,oBAAfM,EAAA,CADCC,aAAA,EAIcC,EAAA,EAAAC,YAAA,CAAU,CAAA,EAHVT,qBAAA"}
|