@directus/extensions-sdk 9.1.1 → 9.2.2
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/cjs/cli/utils/load-config.d.ts.map +1 -1
- package/dist/cjs/cli/utils/load-config.js +1 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +2 -1
- package/dist/esm/cli/utils/load-config.d.ts.map +1 -1
- package/dist/esm/cli/utils/load-config.js +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -1
- package/package.json +3 -3
- package/src/cli/utils/load-config.ts +3 -1
- package/src/index.ts +1 -0
- package/templates/panel/javascript/src/index.js +22 -0
- package/templates/panel/javascript/src/panel.vue +30 -0
- package/templates/panel/typescript/src/index.ts +23 -0
- package/templates/panel/typescript/src/panel.vue +32 -0
- package/templates/panel/typescript/src/shims.d.ts +5 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-config.d.ts","sourceRoot":"","sources":["../../../../src/cli/utils/load-config.ts"],"names":[],"mappings":"AAQA,wBAA8B,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"load-config.d.ts","sourceRoot":"","sources":["../../../../src/cli/utils/load-config.ts"],"names":[],"mappings":"AAQA,wBAA8B,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAYvE"}
|
|
@@ -11,7 +11,7 @@ const _import = new Function('url', 'return import(url)');
|
|
|
11
11
|
async function loadConfig() {
|
|
12
12
|
for (const fileName of CONFIG_FILE_NAMES) {
|
|
13
13
|
if (await fs_extra_1.default.pathExists(fileName)) {
|
|
14
|
-
const configFile = await _import(path_1.default.join(process.cwd(), fileName));
|
|
14
|
+
const configFile = await _import(path_1.default.relative(__dirname, path_1.default.join(process.cwd(), fileName)).split(path_1.default.sep).join(path_1.default.posix.sep));
|
|
15
15
|
return configFile.default;
|
|
16
16
|
}
|
|
17
17
|
}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { defineInterface, defineDisplay, defineLayout, defineModule, defineHook, defineEndpoint, getFieldsFromTemplate, getRelationType, } from '@directus/shared/utils';
|
|
1
|
+
export { defineInterface, defineDisplay, defineLayout, defineModule, definePanel, defineHook, defineEndpoint, getFieldsFromTemplate, getRelationType, } from '@directus/shared/utils';
|
|
2
2
|
export { useStores, useApi, useSync, useCollection, useItems, useFilterFields } from '@directus/shared/composables';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,eAAe,GACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,eAAe,GACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useFilterFields = exports.useItems = exports.useCollection = exports.useSync = exports.useApi = exports.useStores = exports.getRelationType = exports.getFieldsFromTemplate = exports.defineEndpoint = exports.defineHook = exports.defineModule = exports.defineLayout = exports.defineDisplay = exports.defineInterface = void 0;
|
|
3
|
+
exports.useFilterFields = exports.useItems = exports.useCollection = exports.useSync = exports.useApi = exports.useStores = exports.getRelationType = exports.getFieldsFromTemplate = exports.defineEndpoint = exports.defineHook = exports.definePanel = exports.defineModule = exports.defineLayout = exports.defineDisplay = exports.defineInterface = void 0;
|
|
4
4
|
var utils_1 = require("@directus/shared/utils");
|
|
5
5
|
Object.defineProperty(exports, "defineInterface", { enumerable: true, get: function () { return utils_1.defineInterface; } });
|
|
6
6
|
Object.defineProperty(exports, "defineDisplay", { enumerable: true, get: function () { return utils_1.defineDisplay; } });
|
|
7
7
|
Object.defineProperty(exports, "defineLayout", { enumerable: true, get: function () { return utils_1.defineLayout; } });
|
|
8
8
|
Object.defineProperty(exports, "defineModule", { enumerable: true, get: function () { return utils_1.defineModule; } });
|
|
9
|
+
Object.defineProperty(exports, "definePanel", { enumerable: true, get: function () { return utils_1.definePanel; } });
|
|
9
10
|
Object.defineProperty(exports, "defineHook", { enumerable: true, get: function () { return utils_1.defineHook; } });
|
|
10
11
|
Object.defineProperty(exports, "defineEndpoint", { enumerable: true, get: function () { return utils_1.defineEndpoint; } });
|
|
11
12
|
Object.defineProperty(exports, "getFieldsFromTemplate", { enumerable: true, get: function () { return utils_1.getFieldsFromTemplate; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-config.d.ts","sourceRoot":"","sources":["../../../../src/cli/utils/load-config.ts"],"names":[],"mappings":"AAQA,wBAA8B,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"load-config.d.ts","sourceRoot":"","sources":["../../../../src/cli/utils/load-config.ts"],"names":[],"mappings":"AAQA,wBAA8B,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAYvE"}
|
|
@@ -6,7 +6,7 @@ const _import = new Function('url', 'return import(url)');
|
|
|
6
6
|
export default async function loadConfig() {
|
|
7
7
|
for (const fileName of CONFIG_FILE_NAMES) {
|
|
8
8
|
if (await fse.pathExists(fileName)) {
|
|
9
|
-
const configFile = await _import(path.join(process.cwd(), fileName));
|
|
9
|
+
const configFile = await _import(path.relative(__dirname, path.join(process.cwd(), fileName)).split(path.sep).join(path.posix.sep));
|
|
10
10
|
return configFile.default;
|
|
11
11
|
}
|
|
12
12
|
}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { defineInterface, defineDisplay, defineLayout, defineModule, defineHook, defineEndpoint, getFieldsFromTemplate, getRelationType, } from '@directus/shared/utils';
|
|
1
|
+
export { defineInterface, defineDisplay, defineLayout, defineModule, definePanel, defineHook, defineEndpoint, getFieldsFromTemplate, getRelationType, } from '@directus/shared/utils';
|
|
2
2
|
export { useStores, useApi, useSync, useCollection, useItems, useFilterFields } from '@directus/shared/composables';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,eAAe,GACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,eAAe,GACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { defineInterface, defineDisplay, defineLayout, defineModule, defineHook, defineEndpoint, getFieldsFromTemplate, getRelationType, } from '@directus/shared/utils';
|
|
1
|
+
export { defineInterface, defineDisplay, defineLayout, defineModule, definePanel, defineHook, defineEndpoint, getFieldsFromTemplate, getRelationType, } from '@directus/shared/utils';
|
|
2
2
|
export { useStores, useApi, useSync, useCollection, useItems, useFilterFields } from '@directus/shared/composables';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@directus/extensions-sdk",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.2.2",
|
|
4
4
|
"description": "A toolkit to develop extensions to extend Directus.",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"node": ">=12.20.0"
|
|
30
30
|
},
|
|
31
31
|
"author": "Nicola Krumschmidt",
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "546d525175c7ecc6ac9c235b4ebf77a1ae209e10",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@directus/shared": "9.
|
|
34
|
+
"@directus/shared": "9.2.2",
|
|
35
35
|
"@rollup/plugin-commonjs": "^21.0.0",
|
|
36
36
|
"@rollup/plugin-json": "^4.1.0",
|
|
37
37
|
"@rollup/plugin-node-resolve": "^13.0.0",
|
|
@@ -9,7 +9,9 @@ const _import = new Function('url', 'return import(url)');
|
|
|
9
9
|
export default async function loadConfig(): Promise<Record<string, any>> {
|
|
10
10
|
for (const fileName of CONFIG_FILE_NAMES) {
|
|
11
11
|
if (await fse.pathExists(fileName)) {
|
|
12
|
-
const configFile = await _import(
|
|
12
|
+
const configFile = await _import(
|
|
13
|
+
path.relative(__dirname, path.join(process.cwd(), fileName)).split(path.sep).join(path.posix.sep)
|
|
14
|
+
);
|
|
13
15
|
|
|
14
16
|
return configFile.default;
|
|
15
17
|
}
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import PanelComponent from './panel.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
id: 'custom',
|
|
5
|
+
name: 'Custom',
|
|
6
|
+
icon: 'box',
|
|
7
|
+
description: 'This is my custom panel!',
|
|
8
|
+
component: PanelComponent,
|
|
9
|
+
options: [
|
|
10
|
+
{
|
|
11
|
+
field: 'text',
|
|
12
|
+
name: 'Text',
|
|
13
|
+
type: 'string',
|
|
14
|
+
meta: {
|
|
15
|
+
interface: 'input',
|
|
16
|
+
width: 'full',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
minWidth: 12,
|
|
21
|
+
minHeight: 8,
|
|
22
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="text" :class="{ 'has-header': showHeader }">
|
|
3
|
+
{{ text }}
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
export default {
|
|
9
|
+
props: {
|
|
10
|
+
showHeader: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: false,
|
|
13
|
+
},
|
|
14
|
+
text: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: '',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<style scoped>
|
|
23
|
+
.text {
|
|
24
|
+
padding: 12px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.text.has-header {
|
|
28
|
+
padding: 0 12px;
|
|
29
|
+
}
|
|
30
|
+
</style>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { definePanel } from '@directus/extensions-sdk';
|
|
2
|
+
import PanelComponent from './panel.vue';
|
|
3
|
+
|
|
4
|
+
export default definePanel({
|
|
5
|
+
id: 'custom',
|
|
6
|
+
name: 'Custom',
|
|
7
|
+
icon: 'box',
|
|
8
|
+
description: 'This is my custom panel!',
|
|
9
|
+
component: PanelComponent,
|
|
10
|
+
options: [
|
|
11
|
+
{
|
|
12
|
+
field: 'text',
|
|
13
|
+
name: 'Text',
|
|
14
|
+
type: 'string',
|
|
15
|
+
meta: {
|
|
16
|
+
interface: 'input',
|
|
17
|
+
width: 'full',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
minWidth: 12,
|
|
22
|
+
minHeight: 8,
|
|
23
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="text" :class="{ 'has-header': showHeader }">
|
|
3
|
+
{{ text }}
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts">
|
|
8
|
+
import { defineComponent } from 'vue';
|
|
9
|
+
|
|
10
|
+
export default defineComponent({
|
|
11
|
+
props: {
|
|
12
|
+
showHeader: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: false,
|
|
15
|
+
},
|
|
16
|
+
text: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: '',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<style scoped>
|
|
25
|
+
.text {
|
|
26
|
+
padding: 12px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.text.has-header {
|
|
30
|
+
padding: 0 12px;
|
|
31
|
+
}
|
|
32
|
+
</style>
|