feat: update deps, clean up unused dep

This commit is contained in:
Nicola Turcato 2025-08-12 11:45:00 +02:00
parent 2d8c6e6414
commit e9eb39bc66
No known key found for this signature in database
GPG Key ID: D9F5F250B7E4AF08
18 changed files with 1858 additions and 833 deletions

View File

@ -1,5 +1,5 @@
{ {
"$schema": "https://biomejs.dev/schemas/2.0.6/schema.json", "$schema": "https://biomejs.dev/schemas/2.1.4/schema.json",
"vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false }, "vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false },
"files": { "ignoreUnknown": false, "includes": ["**"] }, "files": { "ignoreUnknown": false, "includes": ["**"] },
"formatter": { "formatter": {

33
dist/ContentTree.d.ts vendored
View File

@ -1,14 +1,23 @@
import type { PlainClientAPI } from 'contentful-management'; import type { PlainClientAPI } from 'contentful-management'
import type { PageAppSDK } from 'contentful-ui-extensions-sdk'; import type { PageAppSDK } from 'contentful-ui-extensions-sdk'
import { type ReactElement } from 'react'; import { type ReactElement } from 'react'
export interface ContentTreeProps { export interface ContentTreeProps {
sdkInstance: PageAppSDK; sdkInstance: PageAppSDK
cma: PlainClientAPI; cma: PlainClientAPI
rootType: string; rootType: string
nodeContentTypes: string[]; nodeContentTypes: string[]
titleFields: string[]; titleFields: string[]
locales: string[]; locales: string[]
indentation?: number; indentation?: number
iconRegistry?: Record<string, string>; iconRegistry?: Record<string, string>
} }
export declare const ContentTree: ({ sdkInstance, cma, rootType, nodeContentTypes, titleFields, locales, indentation, iconRegistry, }: ContentTreeProps) => ReactElement; export declare const ContentTree: ({
sdkInstance,
cma,
rootType,
nodeContentTypes,
titleFields,
locales,
indentation,
iconRegistry,
}: ContentTreeProps) => ReactElement

338
dist/ContentTree.js vendored
View File

@ -1,104 +1,270 @@
"use strict"; 'use strict'
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding =
if (k2 === undefined) k2 = k; (this && this.__createBinding) ||
var desc = Object.getOwnPropertyDescriptor(m, k); (Object.create
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { ? function (o, m, k, k2) {
desc = { enumerable: true, get: function() { return m[k]; } }; if (k2 === undefined) k2 = k
var desc = Object.getOwnPropertyDescriptor(m, k)
if (
!desc ||
('get' in desc ? !m.__esModule : desc.writable || desc.configurable)
) {
desc = {
enumerable: true,
get: function () {
return m[k]
},
} }
Object.defineProperty(o, k2, desc); }
}) : (function(o, m, k, k2) { Object.defineProperty(o, k2, desc)
if (k2 === undefined) k2 = k; }
o[k2] = m[k]; : function (o, m, k, k2) {
})); if (k2 === undefined) k2 = k
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { o[k2] = m[k]
Object.defineProperty(o, "default", { enumerable: true, value: v }); })
}) : function(o, v) { var __setModuleDefault =
o["default"] = v; (this && this.__setModuleDefault) ||
}); (Object.create
var __importStar = (this && this.__importStar) || (function () { ? function (o, v) {
Object.defineProperty(o, 'default', { enumerable: true, value: v })
}
: function (o, v) {
o['default'] = v
})
var __importStar =
(this && this.__importStar) ||
(function () {
var ownKeys = function (o) { var ownKeys = function (o) {
ownKeys = Object.getOwnPropertyNames || function (o) { ownKeys =
var ar = []; Object.getOwnPropertyNames ||
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; function (o) {
return ar; var ar = []
}; for (var k in o)
return ownKeys(o); if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k
}; return ar
}
return ownKeys(o)
}
return function (mod) { return function (mod) {
if (mod && mod.__esModule) return mod; if (mod && mod.__esModule) return mod
var result = {}; var result = {}
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); if (mod != null)
__setModuleDefault(result, mod); for (var k = ownKeys(mod), i = 0; i < k.length; i++)
return result; if (k[i] !== 'default') __createBinding(result, mod, k[i])
}; __setModuleDefault(result, mod)
})(); return result
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { }
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } })()
var __awaiter =
(this && this.__awaiter) ||
function (thisArg, _arguments, P, generator) {
function adopt(value) {
return value instanceof P
? value
: new P(function (resolve) {
resolve(value)
})
}
return new (P || (P = Promise))(function (resolve, reject) { return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function fulfilled(value) {
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } try {
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step(generator.next(value))
step((generator = generator.apply(thisArg, _arguments || [])).next()); } catch (e) {
}); reject(e)
}; }
var __generator = (this && this.__generator) || function (thisArg, body) { }
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); function rejected(value) {
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; try {
function verb(n) { return function (v) { return step([n, v]); }; } step(generator['throw'](value))
} catch (e) {
reject(e)
}
}
function step(result) {
result.done
? resolve(result.value)
: adopt(result.value).then(fulfilled, rejected)
}
step((generator = generator.apply(thisArg, _arguments || [])).next())
})
}
var __generator =
(this && this.__generator) ||
function (thisArg, body) {
var _ = {
label: 0,
sent: function () {
if (t[0] & 1) throw t[1]
return t[1]
},
trys: [],
ops: [],
},
f,
y,
t,
g = Object.create(
(typeof Iterator === 'function' ? Iterator : Object).prototype,
)
return (
(g.next = verb(0)),
(g['throw'] = verb(1)),
(g['return'] = verb(2)),
typeof Symbol === 'function' &&
(g[Symbol.iterator] = function () {
return this
}),
g
)
function verb(n) {
return function (v) {
return step([n, v])
}
}
function step(op) { function step(op) {
if (f) throw new TypeError("Generator is already executing."); if (f) throw new TypeError('Generator is already executing.')
while (g && (g = 0, op[0] && (_ = 0)), _) try { while ((g && ((g = 0), op[0] && (_ = 0)), _))
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; try {
if (y = 0, t) op = [op[0] & 2, t.value]; if (
((f = 1),
y &&
(t =
op[0] & 2
? y['return']
: op[0]
? y['throw'] || ((t = y['return']) && t.call(y), 0)
: y.next) &&
!(t = t.call(y, op[1])).done)
)
return t
if (((y = 0), t)) op = [op[0] & 2, t.value]
switch (op[0]) { switch (op[0]) {
case 0: case 1: t = op; break; case 0:
case 4: _.label++; return { value: op[1], done: false }; case 1:
case 5: _.label++; y = op[1]; op = [0]; continue; t = op
case 7: op = _.ops.pop(); _.trys.pop(); continue; break
case 4:
_.label++
return { value: op[1], done: false }
case 5:
_.label++
y = op[1]
op = [0]
continue
case 7:
op = _.ops.pop()
_.trys.pop()
continue
default: default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } !((t = _.trys), (t = t.length > 0 && t[t.length - 1])) &&
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } (op[0] === 6 || op[0] === 2)
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } ) {
if (t[2]) _.ops.pop(); _ = 0
_.trys.pop(); continue; continue
} }
op = body.call(thisArg, _); if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } _.label = op[1]
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; break
} }
}; if (op[0] === 6 && _.label < t[1]) {
Object.defineProperty(exports, "__esModule", { value: true }); _.label = t[1]
exports.ContentTree = void 0; t = op
var react_1 = __importStar(require("react")); break
var ContentTreeRoot_1 = require("./ContentTreeRoot"); }
var ContentTreeUtils_1 = require("./ContentTreeUtils"); if (t && _.label < t[2]) {
_.label = t[2]
_.ops.push(op)
break
}
if (t[2]) _.ops.pop()
_.trys.pop()
continue
}
op = body.call(thisArg, _)
} catch (e) {
op = [6, e]
y = 0
} finally {
f = t = 0
}
if (op[0] & 5) throw op[1]
return { value: op[0] ? op[1] : void 0, done: true }
}
}
Object.defineProperty(exports, '__esModule', { value: true })
exports.ContentTree = void 0
var react_1 = __importStar(require('react'))
var ContentTreeRoot_1 = require('./ContentTreeRoot')
var ContentTreeUtils_1 = require('./ContentTreeUtils')
var ContentTree = function (_a) { var ContentTree = function (_a) {
var sdkInstance = _a.sdkInstance, cma = _a.cma, rootType = _a.rootType, nodeContentTypes = _a.nodeContentTypes, titleFields = _a.titleFields, locales = _a.locales, _b = _a.indentation, indentation = _b === void 0 ? 1 : _b, iconRegistry = _a.iconRegistry; var sdkInstance = _a.sdkInstance,
var stLocale = (0, react_1.useState)(locales[0])[0]; cma = _a.cma,
var _c = (0, react_1.useState)([(0, ContentTreeUtils_1.emptyNodeProps)()]), rootNodes = _c[0], setRootNodes = _c[1]; rootType = _a.rootType,
(0, react_1.useEffect)(function () { nodeContentTypes = _a.nodeContentTypes,
titleFields = _a.titleFields,
locales = _a.locales,
_b = _a.indentation,
indentation = _b === void 0 ? 1 : _b,
iconRegistry = _a.iconRegistry
var stLocale = (0, react_1.useState)(locales[0])[0]
var _c = (0, react_1.useState)([(0, ContentTreeUtils_1.emptyNodeProps)()]),
rootNodes = _c[0],
setRootNodes = _c[1]
;(0, react_1.useEffect)(
function () {
if (sdkInstance) { if (sdkInstance) {
loadData().catch(function (err) { loadData().catch(function (err) {
throw new Error('loadRootData', err); throw new Error('loadRootData', err)
}); })
} }
}, [sdkInstance]); },
var loadData = function () { return __awaiter(void 0, void 0, void 0, function () { [sdkInstance],
var CfRootData, nodes; )
var loadData = function () {
return __awaiter(void 0, void 0, void 0, function () {
var CfRootData, nodes
return __generator(this, function (_a) { return __generator(this, function (_a) {
switch (_a.label) { switch (_a.label) {
case 0: return [4, cma.entry.getMany({ case 0:
return [
4,
cma.entry.getMany({
query: { content_type: rootType }, query: { content_type: rootType },
})]; }),
]
case 1: case 1:
CfRootData = _a.sent(); CfRootData = _a.sent()
nodes = (0, ContentTreeUtils_1.cfEntriesToNodes)(CfRootData.items, titleFields, stLocale, locales, nodeContentTypes, iconRegistry); nodes = (0, ContentTreeUtils_1.cfEntriesToNodes)(
setRootNodes(nodes); CfRootData.items,
return [2]; titleFields,
stLocale,
locales,
nodeContentTypes,
iconRegistry,
)
setRootNodes(nodes)
return [2]
} }
}); })
}); }; })
return (react_1.default.createElement(react_1.default.Fragment, null, rootNodes.map(function (node, i) { return (react_1.default.createElement(ContentTreeRoot_1.ContentTreeRoot, { key: i.toString(), node: node, locales: locales, nodeContentTypes: nodeContentTypes, iconRegistry: iconRegistry, cma: cma, titleFields: titleFields, sdkInstance: sdkInstance, depth: indentation })); }))); }
}; return react_1.default.createElement(
exports.ContentTree = ContentTree; react_1.default.Fragment,
null,
rootNodes.map(function (node, i) {
return react_1.default.createElement(ContentTreeRoot_1.ContentTreeRoot, {
key: i.toString(),
node: node,
locales: locales,
nodeContentTypes: nodeContentTypes,
iconRegistry: iconRegistry,
cma: cma,
titleFields: titleFields,
sdkInstance: sdkInstance,
depth: indentation,
})
}),
)
}
exports.ContentTree = ContentTree

View File

@ -1,14 +1,74 @@
export interface UiPalette { export interface UiPalette {
publishingStatusBg?: string; publishingStatusBg?: string
publishingStatusFg?: string; publishingStatusFg?: string
} }
export declare const StyledContentTreeTable: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, never>> & string; export declare const StyledContentTreeTable: import('styled-components/dist/types').IStyledComponentBase<
export declare const StyledContentTreeTableNodeCell: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, { 'web',
$depth?: number; import('styled-components').FastOmit<
}>> & string; import('react').DetailedHTMLProps<
export declare const StyledContentTreeNodeWedge: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string; import('react').TableHTMLAttributes<HTMLTableElement>,
export declare const StyledContentTreeNodeName: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string; HTMLTableElement
export declare const StyledContentTreeNodePublishingStatus: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, { >,
$status: string; never
}>> & string; >
export declare const StyledSpinner: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string; > &
string
export declare const StyledContentTreeTableNodeCell: import('styled-components/dist/types').IStyledComponentBase<
'web',
import('styled-components/dist/types').Substitute<
import('react').DetailedHTMLProps<
import('react').TdHTMLAttributes<HTMLTableDataCellElement>,
HTMLTableDataCellElement
>,
{
$depth?: number
}
>
> &
string
export declare const StyledContentTreeNodeWedge: import('styled-components/dist/types').IStyledComponentBase<
'web',
import('styled-components').FastOmit<
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLDivElement>,
HTMLDivElement
>,
never
>
> &
string
export declare const StyledContentTreeNodeName: import('styled-components/dist/types').IStyledComponentBase<
'web',
import('styled-components').FastOmit<
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLDivElement>,
HTMLDivElement
>,
never
>
> &
string
export declare const StyledContentTreeNodePublishingStatus: import('styled-components/dist/types').IStyledComponentBase<
'web',
import('styled-components/dist/types').Substitute<
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLDivElement>,
HTMLDivElement
>,
{
$status: string
}
>
> &
string
export declare const StyledSpinner: import('styled-components/dist/types').IStyledComponentBase<
'web',
import('styled-components').FastOmit<
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLDivElement>,
HTMLDivElement
>,
never
>
> &
string

View File

@ -1,37 +1,139 @@
"use strict"; 'use strict'
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { var __makeTemplateObject =
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } (this && this.__makeTemplateObject) ||
return cooked; function (cooked, raw) {
}; if (Object.defineProperty) {
var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(cooked, 'raw', { value: raw })
return (mod && mod.__esModule) ? mod : { "default": mod }; } else {
}; cooked.raw = raw
Object.defineProperty(exports, "__esModule", { value: true }); }
exports.StyledSpinner = exports.StyledContentTreeNodePublishingStatus = exports.StyledContentTreeNodeName = exports.StyledContentTreeNodeWedge = exports.StyledContentTreeTableNodeCell = exports.StyledContentTreeTable = void 0; return cooked
var styled_components_1 = __importDefault(require("styled-components")); }
exports.StyledContentTreeTable = styled_components_1.default.table(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\twidth: 100%;\n\tcolor: black;\n\tborder: 0;\n\tpadding: 0 60px;\n\tmargin: 0 auto;\n\ttd {\n\t\tpadding: 0.2em 1em 0.2em 0.2em;\n\t\tcolor: #999999;\n\t\tborder-bottom: 1px solid #efefef;\n\t}\n\tth {\n\t\ttext-align: left;\n\t\tfont-weight: normal;\n\t\tfont-size: 85%;\n\t\tcolor: #666666;\n\t\tbackground: #efefef;\n\t\tpadding: 0.2em;\n\t}\n\tth.first {\n\t\tfont-weight: bold !important;\n\t\tcolor: black !important;\n\t}\n"], ["\n\twidth: 100%;\n\tcolor: black;\n\tborder: 0;\n\tpadding: 0 60px;\n\tmargin: 0 auto;\n\ttd {\n\t\tpadding: 0.2em 1em 0.2em 0.2em;\n\t\tcolor: #999999;\n\t\tborder-bottom: 1px solid #efefef;\n\t}\n\tth {\n\t\ttext-align: left;\n\t\tfont-weight: normal;\n\t\tfont-size: 85%;\n\t\tcolor: #666666;\n\t\tbackground: #efefef;\n\t\tpadding: 0.2em;\n\t}\n\tth.first {\n\t\tfont-weight: bold !important;\n\t\tcolor: black !important;\n\t}\n"]))); var __importDefault =
exports.StyledContentTreeTableNodeCell = styled_components_1.default.td(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\tpadding-left: ", "em !important;\n\tpadding-right: 2em !important;\n\tcolor: black !important;\n\tmin-width: 450px !important;\n"], ["\n\tpadding-left: ", "em !important;\n\tpadding-right: 2em !important;\n\tcolor: black !important;\n\tmin-width: 450px !important;\n"])), function (props) { return props.$depth; }); (this && this.__importDefault) ||
exports.StyledContentTreeNodeWedge = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n\tdisplay: inline-block;\n\twidth: 1em;\n\ttext-align: left;\n\ta {\n\t\tcursor: pointer;\n\t\tfont-size: 130%;\n\t\tline-height: 100%;\n\t}\n"], ["\n\tdisplay: inline-block;\n\twidth: 1em;\n\ttext-align: left;\n\ta {\n\t\tcursor: pointer;\n\t\tfont-size: 130%;\n\t\tline-height: 100%;\n\t}\n"]))); function (mod) {
exports.StyledContentTreeNodeName = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n\tdisplay: inline-block;\n\ta {\n\t\tcursor: pointer;\n\t}\n\ta:hover {\n\t\ttext-decoration: underline;\n\t}\n"], ["\n\tdisplay: inline-block;\n\ta {\n\t\tcursor: pointer;\n\t}\n\ta:hover {\n\t\ttext-decoration: underline;\n\t}\n"]))); return mod && mod.__esModule ? mod : { default: mod }
}
Object.defineProperty(exports, '__esModule', { value: true })
exports.StyledSpinner =
exports.StyledContentTreeNodePublishingStatus =
exports.StyledContentTreeNodeName =
exports.StyledContentTreeNodeWedge =
exports.StyledContentTreeTableNodeCell =
exports.StyledContentTreeTable =
void 0
var styled_components_1 = __importDefault(require('styled-components'))
exports.StyledContentTreeTable = styled_components_1.default.table(
templateObject_1 ||
(templateObject_1 = __makeTemplateObject(
[
'\n\twidth: 100%;\n\tcolor: black;\n\tborder: 0;\n\tpadding: 0 60px;\n\tmargin: 0 auto;\n\ttd {\n\t\tpadding: 0.2em 1em 0.2em 0.2em;\n\t\tcolor: #999999;\n\t\tborder-bottom: 1px solid #efefef;\n\t}\n\tth {\n\t\ttext-align: left;\n\t\tfont-weight: normal;\n\t\tfont-size: 85%;\n\t\tcolor: #666666;\n\t\tbackground: #efefef;\n\t\tpadding: 0.2em;\n\t}\n\tth.first {\n\t\tfont-weight: bold !important;\n\t\tcolor: black !important;\n\t}\n',
],
[
'\n\twidth: 100%;\n\tcolor: black;\n\tborder: 0;\n\tpadding: 0 60px;\n\tmargin: 0 auto;\n\ttd {\n\t\tpadding: 0.2em 1em 0.2em 0.2em;\n\t\tcolor: #999999;\n\t\tborder-bottom: 1px solid #efefef;\n\t}\n\tth {\n\t\ttext-align: left;\n\t\tfont-weight: normal;\n\t\tfont-size: 85%;\n\t\tcolor: #666666;\n\t\tbackground: #efefef;\n\t\tpadding: 0.2em;\n\t}\n\tth.first {\n\t\tfont-weight: bold !important;\n\t\tcolor: black !important;\n\t}\n',
],
)),
)
exports.StyledContentTreeTableNodeCell = styled_components_1.default.td(
templateObject_2 ||
(templateObject_2 = __makeTemplateObject(
[
'\n\tpadding-left: ',
'em !important;\n\tpadding-right: 2em !important;\n\tcolor: black !important;\n\tmin-width: 450px !important;\n',
],
[
'\n\tpadding-left: ',
'em !important;\n\tpadding-right: 2em !important;\n\tcolor: black !important;\n\tmin-width: 450px !important;\n',
],
)),
function (props) {
return props.$depth
},
)
exports.StyledContentTreeNodeWedge = styled_components_1.default.div(
templateObject_3 ||
(templateObject_3 = __makeTemplateObject(
[
'\n\tdisplay: inline-block;\n\twidth: 1em;\n\ttext-align: left;\n\ta {\n\t\tcursor: pointer;\n\t\tfont-size: 130%;\n\t\tline-height: 100%;\n\t}\n',
],
[
'\n\tdisplay: inline-block;\n\twidth: 1em;\n\ttext-align: left;\n\ta {\n\t\tcursor: pointer;\n\t\tfont-size: 130%;\n\t\tline-height: 100%;\n\t}\n',
],
)),
)
exports.StyledContentTreeNodeName = styled_components_1.default.div(
templateObject_4 ||
(templateObject_4 = __makeTemplateObject(
[
'\n\tdisplay: inline-block;\n\ta {\n\t\tcursor: pointer;\n\t}\n\ta:hover {\n\t\ttext-decoration: underline;\n\t}\n',
],
[
'\n\tdisplay: inline-block;\n\ta {\n\t\tcursor: pointer;\n\t}\n\ta:hover {\n\t\ttext-decoration: underline;\n\t}\n',
],
)),
)
var getPublishingStatusColors = function (status) { var getPublishingStatusColors = function (status) {
switch (status) { switch (status) {
case 'draft': case 'draft':
return { return {
publishingStatusBg: 'rgb(253, 229, 192)', publishingStatusBg: 'rgb(253, 229, 192)',
publishingStatusFg: 'rgb(177, 45, 0)', publishingStatusFg: 'rgb(177, 45, 0)',
}; }
case 'changed': case 'changed':
return { return {
publishingStatusBg: 'rgb(206, 236, 255)', publishingStatusBg: 'rgb(206, 236, 255)',
publishingStatusFg: 'rgb(0, 89, 200)', publishingStatusFg: 'rgb(0, 89, 200)',
}; }
case 'published': case 'published':
return { return {
publishingStatusBg: 'rgb(205, 243, 198)', publishingStatusBg: 'rgb(205, 243, 198)',
publishingStatusFg: 'rgb(0, 109, 35)', publishingStatusFg: 'rgb(0, 109, 35)',
};
} }
}; }
exports.StyledContentTreeNodePublishingStatus = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n\tdisplay: inline-block;\n\tfont-family:\n\t\t-apple-system,\n\t\tBlinkMacSystemFont,\n\t\tSegoe UI,\n\t\tHelvetica,\n\t\tArial,\n\t\tsans-serif,\n\t\tApple Color Emoji,\n\t\tSegoe UI Emoji,\n\t\tSegoe UI Symbol;\n\tfont-weight: 600;\n\tfont-size: 80%;\n\ttext-transform: uppercase;\n\tletter-spacing: 0.06rem;\n\tborder-radius: 4px;\n\tpadding: 0 0.2rem;\n\tcolor: ", " !important;\n\tbackground-color: ", " !important;\n"], ["\n\tdisplay: inline-block;\n\tfont-family:\n\t\t-apple-system,\n\t\tBlinkMacSystemFont,\n\t\tSegoe UI,\n\t\tHelvetica,\n\t\tArial,\n\t\tsans-serif,\n\t\tApple Color Emoji,\n\t\tSegoe UI Emoji,\n\t\tSegoe UI Symbol;\n\tfont-weight: 600;\n\tfont-size: 80%;\n\ttext-transform: uppercase;\n\tletter-spacing: 0.06rem;\n\tborder-radius: 4px;\n\tpadding: 0 0.2rem;\n\tcolor: ", " !important;\n\tbackground-color: ", " !important;\n"])), function (props) { var _a; return (_a = getPublishingStatusColors(props.$status)) === null || _a === void 0 ? void 0 : _a.publishingStatusFg; }, function (props) { var _a; return (_a = getPublishingStatusColors(props.$status)) === null || _a === void 0 ? void 0 : _a.publishingStatusBg; }); }
exports.StyledSpinner = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n\tdisplay: inline-block;\n\twidth: 1em;\n\tanimation: rotate 1s infinite;\n\t@keyframes rotate {\n\t\tfrom {\n\t\t\ttransform: rotate(0deg);\n\t\t}\n\t\tto {\n\t\t\ttransform: rotate(360deg);\n\t\t}\n\t}\n"], ["\n\tdisplay: inline-block;\n\twidth: 1em;\n\tanimation: rotate 1s infinite;\n\t@keyframes rotate {\n\t\tfrom {\n\t\t\ttransform: rotate(0deg);\n\t\t}\n\t\tto {\n\t\t\ttransform: rotate(360deg);\n\t\t}\n\t}\n"]))); exports.StyledContentTreeNodePublishingStatus = styled_components_1.default.div(
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6; templateObject_5 ||
(templateObject_5 = __makeTemplateObject(
[
'\n\tdisplay: inline-block;\n\tfont-family:\n\t\t-apple-system,\n\t\tBlinkMacSystemFont,\n\t\tSegoe UI,\n\t\tHelvetica,\n\t\tArial,\n\t\tsans-serif,\n\t\tApple Color Emoji,\n\t\tSegoe UI Emoji,\n\t\tSegoe UI Symbol;\n\tfont-weight: 600;\n\tfont-size: 80%;\n\ttext-transform: uppercase;\n\tletter-spacing: 0.06rem;\n\tborder-radius: 4px;\n\tpadding: 0 0.2rem;\n\tcolor: ',
' !important;\n\tbackground-color: ',
' !important;\n',
],
[
'\n\tdisplay: inline-block;\n\tfont-family:\n\t\t-apple-system,\n\t\tBlinkMacSystemFont,\n\t\tSegoe UI,\n\t\tHelvetica,\n\t\tArial,\n\t\tsans-serif,\n\t\tApple Color Emoji,\n\t\tSegoe UI Emoji,\n\t\tSegoe UI Symbol;\n\tfont-weight: 600;\n\tfont-size: 80%;\n\ttext-transform: uppercase;\n\tletter-spacing: 0.06rem;\n\tborder-radius: 4px;\n\tpadding: 0 0.2rem;\n\tcolor: ',
' !important;\n\tbackground-color: ',
' !important;\n',
],
)),
function (props) {
var _a
return (_a = getPublishingStatusColors(props.$status)) === null ||
_a === void 0
? void 0
: _a.publishingStatusFg
},
function (props) {
var _a
return (_a = getPublishingStatusColors(props.$status)) === null ||
_a === void 0
? void 0
: _a.publishingStatusBg
},
)
exports.StyledSpinner = styled_components_1.default.div(
templateObject_6 ||
(templateObject_6 = __makeTemplateObject(
[
'\n\tdisplay: inline-block;\n\twidth: 1em;\n\tanimation: rotate 1s infinite;\n\t@keyframes rotate {\n\t\tfrom {\n\t\t\ttransform: rotate(0deg);\n\t\t}\n\t\tto {\n\t\t\ttransform: rotate(360deg);\n\t\t}\n\t}\n',
],
[
'\n\tdisplay: inline-block;\n\twidth: 1em;\n\tanimation: rotate 1s infinite;\n\t@keyframes rotate {\n\t\tfrom {\n\t\t\ttransform: rotate(0deg);\n\t\t}\n\t\tto {\n\t\t\ttransform: rotate(360deg);\n\t\t}\n\t}\n',
],
)),
)
var templateObject_1,
templateObject_2,
templateObject_3,
templateObject_4,
templateObject_5,
templateObject_6

View File

@ -1,22 +1,22 @@
import { type ReactElement } from 'react'; import { type ReactElement } from 'react'
export interface ContentTreeNodeProps { export interface ContentTreeNodeProps {
id: string; id: string
name: string; name: string
contentType?: string; contentType?: string
icon?: string; icon?: string
expand: boolean; expand: boolean
parentId?: string; parentId?: string
childNodes?: ContentTreeNodeProps[]; childNodes?: ContentTreeNodeProps[]
hasChildNodes?: boolean; hasChildNodes?: boolean
publishingStatus?: string; publishingStatus?: string
updatedAt?: string; updatedAt?: string
publishedAt?: string; publishedAt?: string
} }
declare const ContentTreeNode: (props: { declare const ContentTreeNode: (props: {
node: ContentTreeNodeProps; node: ContentTreeNodeProps
depth?: number; depth?: number
addChildNodes: (node: ContentTreeNodeProps) => Promise<void>; addChildNodes: (node: ContentTreeNodeProps) => Promise<void>
removeChildNodes: (node: ContentTreeNodeProps) => void; removeChildNodes: (node: ContentTreeNodeProps) => void
editEntry: (nodeId: string) => Promise<void>; editEntry: (nodeId: string) => Promise<void>
}) => ReactElement; }) => ReactElement
export default ContentTreeNode; export default ContentTreeNode

View File

@ -1,123 +1,317 @@
"use strict"; 'use strict'
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding =
if (k2 === undefined) k2 = k; (this && this.__createBinding) ||
var desc = Object.getOwnPropertyDescriptor(m, k); (Object.create
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { ? function (o, m, k, k2) {
desc = { enumerable: true, get: function() { return m[k]; } }; if (k2 === undefined) k2 = k
var desc = Object.getOwnPropertyDescriptor(m, k)
if (
!desc ||
('get' in desc ? !m.__esModule : desc.writable || desc.configurable)
) {
desc = {
enumerable: true,
get: function () {
return m[k]
},
} }
Object.defineProperty(o, k2, desc); }
}) : (function(o, m, k, k2) { Object.defineProperty(o, k2, desc)
if (k2 === undefined) k2 = k; }
o[k2] = m[k]; : function (o, m, k, k2) {
})); if (k2 === undefined) k2 = k
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { o[k2] = m[k]
Object.defineProperty(o, "default", { enumerable: true, value: v }); })
}) : function(o, v) { var __setModuleDefault =
o["default"] = v; (this && this.__setModuleDefault) ||
}); (Object.create
var __importStar = (this && this.__importStar) || (function () { ? function (o, v) {
Object.defineProperty(o, 'default', { enumerable: true, value: v })
}
: function (o, v) {
o['default'] = v
})
var __importStar =
(this && this.__importStar) ||
(function () {
var ownKeys = function (o) { var ownKeys = function (o) {
ownKeys = Object.getOwnPropertyNames || function (o) { ownKeys =
var ar = []; Object.getOwnPropertyNames ||
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; function (o) {
return ar; var ar = []
}; for (var k in o)
return ownKeys(o); if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k
}; return ar
}
return ownKeys(o)
}
return function (mod) { return function (mod) {
if (mod && mod.__esModule) return mod; if (mod && mod.__esModule) return mod
var result = {}; var result = {}
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); if (mod != null)
__setModuleDefault(result, mod); for (var k = ownKeys(mod), i = 0; i < k.length; i++)
return result; if (k[i] !== 'default') __createBinding(result, mod, k[i])
}; __setModuleDefault(result, mod)
})(); return result
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { }
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } })()
var __awaiter =
(this && this.__awaiter) ||
function (thisArg, _arguments, P, generator) {
function adopt(value) {
return value instanceof P
? value
: new P(function (resolve) {
resolve(value)
})
}
return new (P || (P = Promise))(function (resolve, reject) { return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function fulfilled(value) {
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } try {
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step(generator.next(value))
step((generator = generator.apply(thisArg, _arguments || [])).next()); } catch (e) {
}); reject(e)
}; }
var __generator = (this && this.__generator) || function (thisArg, body) { }
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); function rejected(value) {
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; try {
function verb(n) { return function (v) { return step([n, v]); }; } step(generator['throw'](value))
} catch (e) {
reject(e)
}
}
function step(result) {
result.done
? resolve(result.value)
: adopt(result.value).then(fulfilled, rejected)
}
step((generator = generator.apply(thisArg, _arguments || [])).next())
})
}
var __generator =
(this && this.__generator) ||
function (thisArg, body) {
var _ = {
label: 0,
sent: function () {
if (t[0] & 1) throw t[1]
return t[1]
},
trys: [],
ops: [],
},
f,
y,
t,
g = Object.create(
(typeof Iterator === 'function' ? Iterator : Object).prototype,
)
return (
(g.next = verb(0)),
(g['throw'] = verb(1)),
(g['return'] = verb(2)),
typeof Symbol === 'function' &&
(g[Symbol.iterator] = function () {
return this
}),
g
)
function verb(n) {
return function (v) {
return step([n, v])
}
}
function step(op) { function step(op) {
if (f) throw new TypeError("Generator is already executing."); if (f) throw new TypeError('Generator is already executing.')
while (g && (g = 0, op[0] && (_ = 0)), _) try { while ((g && ((g = 0), op[0] && (_ = 0)), _))
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; try {
if (y = 0, t) op = [op[0] & 2, t.value]; if (
((f = 1),
y &&
(t =
op[0] & 2
? y['return']
: op[0]
? y['throw'] || ((t = y['return']) && t.call(y), 0)
: y.next) &&
!(t = t.call(y, op[1])).done)
)
return t
if (((y = 0), t)) op = [op[0] & 2, t.value]
switch (op[0]) { switch (op[0]) {
case 0: case 1: t = op; break; case 0:
case 4: _.label++; return { value: op[1], done: false }; case 1:
case 5: _.label++; y = op[1]; op = [0]; continue; t = op
case 7: op = _.ops.pop(); _.trys.pop(); continue; break
case 4:
_.label++
return { value: op[1], done: false }
case 5:
_.label++
y = op[1]
op = [0]
continue
case 7:
op = _.ops.pop()
_.trys.pop()
continue
default: default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } !((t = _.trys), (t = t.length > 0 && t[t.length - 1])) &&
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } (op[0] === 6 || op[0] === 2)
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } ) {
if (t[2]) _.ops.pop(); _ = 0
_.trys.pop(); continue; continue
} }
op = body.call(thisArg, _); if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } _.label = op[1]
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; break
} }
}; if (op[0] === 6 && _.label < t[1]) {
Object.defineProperty(exports, "__esModule", { value: true }); _.label = t[1]
var react_1 = __importStar(require("react")); t = op
var ContentTree_styled_1 = require("./ContentTree.styled"); break
var Icons_1 = require("./Icons"); }
if (t && _.label < t[2]) {
_.label = t[2]
_.ops.push(op)
break
}
if (t[2]) _.ops.pop()
_.trys.pop()
continue
}
op = body.call(thisArg, _)
} catch (e) {
op = [6, e]
y = 0
} finally {
f = t = 0
}
if (op[0] & 5) throw op[1]
return { value: op[0] ? op[1] : void 0, done: true }
}
}
Object.defineProperty(exports, '__esModule', { value: true })
var react_1 = __importStar(require('react'))
var ContentTree_styled_1 = require('./ContentTree.styled')
var Icons_1 = require('./Icons')
var ContentTreeNode = function (props) { var ContentTreeNode = function (props) {
var _a, _b; var _a, _b
var _c = (0, react_1.useState)(false), loading = _c[0], setLoading = _c[1]; var _c = (0, react_1.useState)(false),
var addChildren = function (node) { return __awaiter(void 0, void 0, void 0, function () { loading = _c[0],
setLoading = _c[1]
var addChildren = function (node) {
return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) { return __generator(this, function (_a) {
switch (_a.label) { switch (_a.label) {
case 0: case 0:
setLoading(true); setLoading(true)
return [4, props.addChildNodes(node)]; return [4, props.addChildNodes(node)]
case 1: case 1:
_a.sent(); _a.sent()
setLoading(false); setLoading(false)
return [2]; return [2]
}
})
})
} }
});
}); };
var handleEditEntry = function () { var handleEditEntry = function () {
props.editEntry(props.node.id).catch(function (err) { props.editEntry(props.node.id).catch(function (err) {
throw new Error('handleEditEntry', err); throw new Error('handleEditEntry', err)
}); })
}; }
var handleAddChildren = function (node) { var handleAddChildren = function (node) {
addChildren(node).catch(function (err) { addChildren(node).catch(function (err) {
throw new Error('handleAddChildren', err); throw new Error('handleAddChildren', err)
}); })
}; }
return (react_1.default.createElement(react_1.default.Fragment, null, return react_1.default.createElement(
react_1.default.createElement("tr", null, react_1.default.Fragment,
react_1.default.createElement(ContentTree_styled_1.StyledContentTreeTableNodeCell, { "$depth": props.depth }, null,
react_1.default.createElement(ContentTree_styled_1.StyledContentTreeNodeWedge, null, loading ? (react_1.default.createElement(ContentTree_styled_1.StyledSpinner, null, "-")) : props.node.hasChildNodes ? (props.node.expand ? (react_1.default.createElement("a", { onClick: function () { react_1.default.createElement(
handleAddChildren(props.node); 'tr',
} }, "+")) : (react_1.default.createElement("a", { onClick: function () { null,
props.removeChildNodes(props.node); react_1.default.createElement(
} }, "-"))) : null), ContentTree_styled_1.StyledContentTreeTableNodeCell,
{ $depth: props.depth },
react_1.default.createElement(
ContentTree_styled_1.StyledContentTreeNodeWedge,
null,
loading
? react_1.default.createElement(
ContentTree_styled_1.StyledSpinner,
null,
'-',
)
: props.node.hasChildNodes
? props.node.expand
? react_1.default.createElement(
'a',
{
onClick: function () {
handleAddChildren(props.node)
},
},
'+',
)
: react_1.default.createElement(
'a',
{
onClick: function () {
props.removeChildNodes(props.node)
},
},
'-',
)
: null,
),
react_1.default.createElement(Icons_1.Icon, { id: props.node.icon }), react_1.default.createElement(Icons_1.Icon, { id: props.node.icon }),
react_1.default.createElement(ContentTree_styled_1.StyledContentTreeNodeName, null, react_1.default.createElement(
react_1.default.createElement("a", { onClick: function () { ContentTree_styled_1.StyledContentTreeNodeName,
handleEditEntry(); null,
}, title: props.node.id }, props.node.name))), react_1.default.createElement(
react_1.default.createElement("td", null, props.node.contentType), 'a',
react_1.default.createElement("td", null, {
react_1.default.createElement(ContentTree_styled_1.StyledContentTreeNodePublishingStatus, { "$status": (_a = props.node.publishingStatus) !== null && _a !== void 0 ? _a : '' }, props.node.publishingStatus)), onClick: function () {
react_1.default.createElement("td", null, props.node.updatedAt), handleEditEntry()
react_1.default.createElement("td", null, props.node.publishedAt)), (_b = props.node.childNodes) === null || _b === void 0 ? void 0 : },
_b.map(function (node, i) { title: props.node.id,
return (react_1.default.createElement(ContentTreeNode, { key: i.toString(), node: node, depth: props.depth && props.depth + 1, addChildNodes: props.addChildNodes, removeChildNodes: props.removeChildNodes, editEntry: props.editEntry })); },
}))); props.node.name,
}; ),
exports.default = ContentTreeNode; ),
),
react_1.default.createElement('td', null, props.node.contentType),
react_1.default.createElement(
'td',
null,
react_1.default.createElement(
ContentTree_styled_1.StyledContentTreeNodePublishingStatus,
{
$status:
(_a = props.node.publishingStatus) !== null && _a !== void 0
? _a
: '',
},
props.node.publishingStatus,
),
),
react_1.default.createElement('td', null, props.node.updatedAt),
react_1.default.createElement('td', null, props.node.publishedAt),
),
(_b = props.node.childNodes) === null || _b === void 0
? void 0
: _b.map(function (node, i) {
return react_1.default.createElement(ContentTreeNode, {
key: i.toString(),
node: node,
depth: props.depth && props.depth + 1,
addChildNodes: props.addChildNodes,
removeChildNodes: props.removeChildNodes,
editEntry: props.editEntry,
})
}),
)
}
exports.default = ContentTreeNode

View File

@ -1,15 +1,24 @@
import type { PlainClientAPI } from 'contentful-management'; import type { PlainClientAPI } from 'contentful-management'
import type { PageAppSDK } from 'contentful-ui-extensions-sdk'; import type { PageAppSDK } from 'contentful-ui-extensions-sdk'
import { type ReactElement } from 'react'; import { type ReactElement } from 'react'
import { type ContentTreeNodeProps } from './ContentTreeNode'; import { type ContentTreeNodeProps } from './ContentTreeNode'
export interface ContentTreeRootProps { export interface ContentTreeRootProps {
node: ContentTreeNodeProps; node: ContentTreeNodeProps
sdkInstance: PageAppSDK; sdkInstance: PageAppSDK
cma: PlainClientAPI; cma: PlainClientAPI
nodeContentTypes: string[]; nodeContentTypes: string[]
titleFields: string[]; titleFields: string[]
locales: string[]; locales: string[]
depth: number; depth: number
iconRegistry?: Record<string, string>; iconRegistry?: Record<string, string>
} }
export declare const ContentTreeRoot: ({ node, sdkInstance, cma, nodeContentTypes, titleFields, locales, depth, iconRegistry, }: ContentTreeRootProps) => ReactElement; export declare const ContentTreeRoot: ({
node,
sdkInstance,
cma,
nodeContentTypes,
titleFields,
locales,
depth,
iconRegistry,
}: ContentTreeRootProps) => ReactElement

View File

@ -1,271 +1,512 @@
"use strict"; 'use strict'
var __assign = (this && this.__assign) || function () { var __assign =
__assign = Object.assign || function(t) { (this && this.__assign) ||
function () {
__assign =
Object.assign ||
function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) { for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i]; s = arguments[i]
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) for (var p in s)
t[p] = s[p]; if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]
} }
return t; return t
};
return __assign.apply(this, arguments);
};
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
} }
Object.defineProperty(o, k2, desc); return __assign.apply(this, arguments)
}) : (function(o, m, k, k2) { }
if (k2 === undefined) k2 = k; var __createBinding =
o[k2] = m[k]; (this && this.__createBinding) ||
})); (Object.create
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { ? function (o, m, k, k2) {
Object.defineProperty(o, "default", { enumerable: true, value: v }); if (k2 === undefined) k2 = k
}) : function(o, v) { var desc = Object.getOwnPropertyDescriptor(m, k)
o["default"] = v; if (
}); !desc ||
var __importStar = (this && this.__importStar) || (function () { ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)
) {
desc = {
enumerable: true,
get: function () {
return m[k]
},
}
}
Object.defineProperty(o, k2, desc)
}
: function (o, m, k, k2) {
if (k2 === undefined) k2 = k
o[k2] = m[k]
})
var __setModuleDefault =
(this && this.__setModuleDefault) ||
(Object.create
? function (o, v) {
Object.defineProperty(o, 'default', { enumerable: true, value: v })
}
: function (o, v) {
o['default'] = v
})
var __importStar =
(this && this.__importStar) ||
(function () {
var ownKeys = function (o) { var ownKeys = function (o) {
ownKeys = Object.getOwnPropertyNames || function (o) { ownKeys =
var ar = []; Object.getOwnPropertyNames ||
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; function (o) {
return ar; var ar = []
}; for (var k in o)
return ownKeys(o); if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k
}; return ar
}
return ownKeys(o)
}
return function (mod) { return function (mod) {
if (mod && mod.__esModule) return mod; if (mod && mod.__esModule) return mod
var result = {}; var result = {}
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); if (mod != null)
__setModuleDefault(result, mod); for (var k = ownKeys(mod), i = 0; i < k.length; i++)
return result; if (k[i] !== 'default') __createBinding(result, mod, k[i])
}; __setModuleDefault(result, mod)
})(); return result
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { }
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } })()
var __awaiter =
(this && this.__awaiter) ||
function (thisArg, _arguments, P, generator) {
function adopt(value) {
return value instanceof P
? value
: new P(function (resolve) {
resolve(value)
})
}
return new (P || (P = Promise))(function (resolve, reject) { return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function fulfilled(value) {
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } try {
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step(generator.next(value))
step((generator = generator.apply(thisArg, _arguments || [])).next()); } catch (e) {
}); reject(e)
}; }
var __generator = (this && this.__generator) || function (thisArg, body) { }
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); function rejected(value) {
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; try {
function verb(n) { return function (v) { return step([n, v]); }; } step(generator['throw'](value))
} catch (e) {
reject(e)
}
}
function step(result) {
result.done
? resolve(result.value)
: adopt(result.value).then(fulfilled, rejected)
}
step((generator = generator.apply(thisArg, _arguments || [])).next())
})
}
var __generator =
(this && this.__generator) ||
function (thisArg, body) {
var _ = {
label: 0,
sent: function () {
if (t[0] & 1) throw t[1]
return t[1]
},
trys: [],
ops: [],
},
f,
y,
t,
g = Object.create(
(typeof Iterator === 'function' ? Iterator : Object).prototype,
)
return (
(g.next = verb(0)),
(g['throw'] = verb(1)),
(g['return'] = verb(2)),
typeof Symbol === 'function' &&
(g[Symbol.iterator] = function () {
return this
}),
g
)
function verb(n) {
return function (v) {
return step([n, v])
}
}
function step(op) { function step(op) {
if (f) throw new TypeError("Generator is already executing."); if (f) throw new TypeError('Generator is already executing.')
while (g && (g = 0, op[0] && (_ = 0)), _) try { while ((g && ((g = 0), op[0] && (_ = 0)), _))
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; try {
if (y = 0, t) op = [op[0] & 2, t.value]; if (
((f = 1),
y &&
(t =
op[0] & 2
? y['return']
: op[0]
? y['throw'] || ((t = y['return']) && t.call(y), 0)
: y.next) &&
!(t = t.call(y, op[1])).done)
)
return t
if (((y = 0), t)) op = [op[0] & 2, t.value]
switch (op[0]) { switch (op[0]) {
case 0: case 1: t = op; break; case 0:
case 4: _.label++; return { value: op[1], done: false }; case 1:
case 5: _.label++; y = op[1]; op = [0]; continue; t = op
case 7: op = _.ops.pop(); _.trys.pop(); continue; break
case 4:
_.label++
return { value: op[1], done: false }
case 5:
_.label++
y = op[1]
op = [0]
continue
case 7:
op = _.ops.pop()
_.trys.pop()
continue
default: default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } !((t = _.trys), (t = t.length > 0 && t[t.length - 1])) &&
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } (op[0] === 6 || op[0] === 2)
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } ) {
if (t[2]) _.ops.pop(); _ = 0
_.trys.pop(); continue; continue
} }
op = body.call(thisArg, _); if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } _.label = op[1]
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; break
} }
}; if (op[0] === 6 && _.label < t[1]) {
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { _.label = t[1]
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { t = op
break
}
if (t && _.label < t[2]) {
_.label = t[2]
_.ops.push(op)
break
}
if (t[2]) _.ops.pop()
_.trys.pop()
continue
}
op = body.call(thisArg, _)
} catch (e) {
op = [6, e]
y = 0
} finally {
f = t = 0
}
if (op[0] & 5) throw op[1]
return { value: op[0] ? op[1] : void 0, done: true }
}
}
var __spreadArray =
(this && this.__spreadArray) ||
function (to, from, pack) {
if (pack || arguments.length === 2)
for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) { if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i); if (!ar) ar = Array.prototype.slice.call(from, 0, i)
ar[i] = from[i]; ar[i] = from[i]
} }
} }
return to.concat(ar || Array.prototype.slice.call(from)); return to.concat(ar || Array.prototype.slice.call(from))
}; }
var __importDefault = (this && this.__importDefault) || function (mod) { var __importDefault =
return (mod && mod.__esModule) ? mod : { "default": mod }; (this && this.__importDefault) ||
}; function (mod) {
Object.defineProperty(exports, "__esModule", { value: true }); return mod && mod.__esModule ? mod : { default: mod }
exports.ContentTreeRoot = void 0; }
var react_1 = __importStar(require("react")); Object.defineProperty(exports, '__esModule', { value: true })
var ContentTree_styled_1 = require("./ContentTree.styled"); exports.ContentTreeRoot = void 0
var ContentTreeNode_1 = __importDefault(require("./ContentTreeNode")); var react_1 = __importStar(require('react'))
var ContentTreeUtils_1 = require("./ContentTreeUtils"); var ContentTree_styled_1 = require('./ContentTree.styled')
var ContentTreeNode_1 = __importDefault(require('./ContentTreeNode'))
var ContentTreeUtils_1 = require('./ContentTreeUtils')
var ContentTreeRoot = function (_a) { var ContentTreeRoot = function (_a) {
var node = _a.node, sdkInstance = _a.sdkInstance, cma = _a.cma, nodeContentTypes = _a.nodeContentTypes, titleFields = _a.titleFields, locales = _a.locales, depth = _a.depth, iconRegistry = _a.iconRegistry; var node = _a.node,
var stLocale = (0, react_1.useState)(locales[0])[0]; sdkInstance = _a.sdkInstance,
var _b = (0, react_1.useState)((0, ContentTreeUtils_1.emptyNodeProps)()), stRoot = _b[0], setStRoot = _b[1]; cma = _a.cma,
(0, react_1.useEffect)(function () { nodeContentTypes = _a.nodeContentTypes,
titleFields = _a.titleFields,
locales = _a.locales,
depth = _a.depth,
iconRegistry = _a.iconRegistry
var stLocale = (0, react_1.useState)(locales[0])[0]
var _b = (0, react_1.useState)((0, ContentTreeUtils_1.emptyNodeProps)()),
stRoot = _b[0],
setStRoot = _b[1]
;(0, react_1.useEffect)(
function () {
if (node.id) { if (node.id) {
loadRootData(node).catch(function (err) { loadRootData(node).catch(function (err) {
throw new Error('loadRootData', err); throw new Error('loadRootData', err)
}); })
} }
}, [node]); },
var loadRootData = function (rootNode) { return __awaiter(void 0, void 0, void 0, function () { [node],
var childEntries, childNodes, nodes, newIdPositionMap_1, tree_1; )
return __generator(this, function (_a) { var loadRootData = function (rootNode) {
switch (_a.label) { return __awaiter(void 0, void 0, void 0, function () {
case 0: return [4, getContentfulChildEntries(rootNode.id)]; var childEntries, childNodes, nodes, newIdPositionMap_1, tree_1
case 1:
childEntries = _a.sent();
childNodes = (0, ContentTreeUtils_1.cfEntriesToNodes)(childEntries, titleFields, stLocale, locales, nodeContentTypes, iconRegistry, rootNode.id);
nodes = __spreadArray([rootNode], childNodes, true);
if (nodes.length > 0) {
newIdPositionMap_1 = nodes.reduce(function (acc, el, i) {
acc[el.id] = i;
return acc;
}, {});
tree_1 = (0, ContentTreeUtils_1.emptyNodeProps)();
nodes.forEach(function (node) {
var _a;
node.childNodes = [];
if (!node.parentId) {
tree_1 = node;
return;
}
var parentEl = nodes[newIdPositionMap_1[node.parentId]];
if (parentEl) {
parentEl.childNodes = __spreadArray(__spreadArray([], ((_a = parentEl.childNodes) !== null && _a !== void 0 ? _a : []), true), [node], false);
parentEl.expand = false;
}
});
console.log('🌴 tree', tree_1);
setStRoot(tree_1);
}
return [2];
}
});
}); };
var addChildNodes = function (node) { return __awaiter(void 0, void 0, void 0, function () {
var childNodes, cfChildren;
return __generator(this, function (_a) { return __generator(this, function (_a) {
switch (_a.label) { switch (_a.label) {
case 0: case 0:
childNodes = []; return [4, getContentfulChildEntries(rootNode.id)]
return [4, getContentfulChildEntries(node.id)];
case 1: case 1:
cfChildren = _a.sent(); childEntries = _a.sent()
childNodes = (0, ContentTreeUtils_1.cfEntriesToNodes)(cfChildren, titleFields, stLocale, locales, nodeContentTypes, iconRegistry, node.id); childNodes = (0, ContentTreeUtils_1.cfEntriesToNodes)(
setStRoot(function (prevState) { childEntries,
var newState = __assign({}, prevState); titleFields,
recursiveProcessNodes(node.id, function (targetNode) { stLocale,
targetNode.childNodes = childNodes; locales,
targetNode.expand = false; nodeContentTypes,
}, newState); iconRegistry,
return newState; rootNode.id,
}); )
return [2]; nodes = __spreadArray([rootNode], childNodes, true)
if (nodes.length > 0) {
newIdPositionMap_1 = nodes.reduce(function (acc, el, i) {
acc[el.id] = i
return acc
}, {})
tree_1 = (0, ContentTreeUtils_1.emptyNodeProps)()
nodes.forEach(function (node) {
var _a
node.childNodes = []
if (!node.parentId) {
tree_1 = node
return
}
var parentEl = nodes[newIdPositionMap_1[node.parentId]]
if (parentEl) {
parentEl.childNodes = __spreadArray(
__spreadArray(
[],
(_a = parentEl.childNodes) !== null && _a !== void 0
? _a
: [],
true,
),
[node],
false,
)
parentEl.expand = false
}
})
console.log('🌴 tree', tree_1)
setStRoot(tree_1)
}
return [2]
}
})
})
}
var addChildNodes = function (node) {
return __awaiter(void 0, void 0, void 0, function () {
var childNodes, cfChildren
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
childNodes = []
return [4, getContentfulChildEntries(node.id)]
case 1:
cfChildren = _a.sent()
childNodes = (0, ContentTreeUtils_1.cfEntriesToNodes)(
cfChildren,
titleFields,
stLocale,
locales,
nodeContentTypes,
iconRegistry,
node.id,
)
setStRoot(function (prevState) {
var newState = __assign({}, prevState)
recursiveProcessNodes(
node.id,
function (targetNode) {
targetNode.childNodes = childNodes
targetNode.expand = false
},
newState,
)
return newState
})
return [2]
}
})
})
} }
});
}); };
var recursiveProcessNodes = function (targetNodeId, processNode, node) { var recursiveProcessNodes = function (targetNodeId, processNode, node) {
if (node.id === targetNodeId) { if (node.id === targetNodeId) {
processNode(node); processNode(node)
} }
if (node.childNodes != null) { if (node.childNodes != null) {
for (var _i = 0, _a = node.childNodes; _i < _a.length; _i++) { for (var _i = 0, _a = node.childNodes; _i < _a.length; _i++) {
var targetNode = _a[_i]; var targetNode = _a[_i]
recursiveProcessNodes(targetNodeId, processNode, targetNode); recursiveProcessNodes(targetNodeId, processNode, targetNode)
} }
} }
}; }
var editEntry = function (entryId) { return __awaiter(void 0, void 0, void 0, function () { var editEntry = function (entryId) {
return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) { return __generator(this, function (_a) {
switch (_a.label) { switch (_a.label) {
case 0: return [4, sdkInstance.navigator.openEntry(entryId, { slideIn: true })]; case 0:
return [
4,
sdkInstance.navigator.openEntry(entryId, { slideIn: true }),
]
case 1: case 1:
_a.sent(); _a.sent()
return [2]; return [2]
} }
}); })
}); }; })
var getContentfulChildEntries = function (parentId) { return __awaiter(void 0, void 0, void 0, function () { }
var parentItem, allChildIds, _i, _a, key, childNodeRefs, _b, childNodeRefs_1, childNodeRef, allItems, done, skip, col, cfChildren, idPositionMap, _c, allChildIds_1, childId; var getContentfulChildEntries = function (parentId) {
return __awaiter(void 0, void 0, void 0, function () {
var parentItem,
allChildIds,
_i,
_a,
key,
childNodeRefs,
_b,
childNodeRefs_1,
childNodeRef,
allItems,
done,
skip,
col,
cfChildren,
idPositionMap,
_c,
allChildIds_1,
childId
return __generator(this, function (_d) { return __generator(this, function (_d) {
switch (_d.label) { switch (_d.label) {
case 0: return [4, cma.entry.get({ entryId: parentId })]; case 0:
return [4, cma.entry.get({ entryId: parentId })]
case 1: case 1:
parentItem = _d.sent(); parentItem = _d.sent()
allChildIds = []; allChildIds = []
for (_i = 0, _a = Object.keys(parentItem.fields); _i < _a.length; _i++) { for (
key = _a[_i]; _i = 0, _a = Object.keys(parentItem.fields);
_i < _a.length;
_i++
) {
key = _a[_i]
if (nodeContentTypes.includes(key)) { if (nodeContentTypes.includes(key)) {
childNodeRefs = parentItem.fields[key][stLocale]; childNodeRefs = parentItem.fields[key][stLocale]
if (Array.isArray(childNodeRefs)) { if (Array.isArray(childNodeRefs)) {
for (_b = 0, childNodeRefs_1 = childNodeRefs; _b < childNodeRefs_1.length; _b++) { for (
childNodeRef = childNodeRefs_1[_b]; _b = 0, childNodeRefs_1 = childNodeRefs;
allChildIds.push(childNodeRef.sys.id); _b < childNodeRefs_1.length;
_b++
) {
childNodeRef = childNodeRefs_1[_b]
allChildIds.push(childNodeRef.sys.id)
} }
} } else {
else { allChildIds.push(childNodeRefs.sys.id)
allChildIds.push(childNodeRefs.sys.id);
} }
} }
} }
allItems = []; allItems = []
done = false; done = false
skip = 0; skip = 0
_d.label = 2; _d.label = 2
case 2: case 2:
if (!!done) return [3, 4]; if (!!done) return [3, 4]
return [4, cma.entry.getMany({ return [
4,
cma.entry.getMany({
query: { query: {
'sys.id[in]': allChildIds.join(','), 'sys.id[in]': allChildIds.join(','),
skip: skip, skip: skip,
}, },
})]; }),
]
case 3: case 3:
col = _d.sent(); col = _d.sent()
allItems.push.apply(allItems, col.items); allItems.push.apply(allItems, col.items)
if (allItems.length < col.total) { if (allItems.length < col.total) {
skip += 100; skip += 100
} else {
done = true
} }
else { return [3, 2]
done = true;
}
return [3, 2];
case 4: case 4:
cfChildren = []; cfChildren = []
idPositionMap = allItems.reduce(function (acc, el, i) { idPositionMap = allItems.reduce(function (acc, el, i) {
acc[el.sys.id] = i; acc[el.sys.id] = i
return acc; return acc
}, {}); }, {})
for (_c = 0, allChildIds_1 = allChildIds; _c < allChildIds_1.length; _c++) { for (
childId = allChildIds_1[_c]; _c = 0, allChildIds_1 = allChildIds;
_c < allChildIds_1.length;
_c++
) {
childId = allChildIds_1[_c]
if (allItems[idPositionMap[childId]]) { if (allItems[idPositionMap[childId]]) {
cfChildren.push(allItems[idPositionMap[childId]]); cfChildren.push(allItems[idPositionMap[childId]])
} }
} }
return [2, cfChildren]; return [2, cfChildren]
}
})
})
} }
});
}); };
var removeChildNodes = function (node) { var removeChildNodes = function (node) {
setStRoot(function (prevState) { setStRoot(function (prevState) {
var newState = __assign({}, prevState); var newState = __assign({}, prevState)
recursiveProcessNodes(node.id, function (targetNode) { recursiveProcessNodes(
targetNode.childNodes = []; node.id,
targetNode.expand = true; function (targetNode) {
}, newState); targetNode.childNodes = []
return newState; targetNode.expand = true
}); },
}; newState,
return (react_1.default.createElement(react_1.default.Fragment, null, )
react_1.default.createElement(ContentTree_styled_1.StyledContentTreeTable, null, return newState
react_1.default.createElement("tbody", null, })
react_1.default.createElement("tr", null, }
react_1.default.createElement("th", null, "Nodes"), return react_1.default.createElement(
react_1.default.createElement("th", null, "Content Type"), react_1.default.Fragment,
react_1.default.createElement("th", null, "Status"), null,
react_1.default.createElement("th", null, "Last Modified"), react_1.default.createElement(
react_1.default.createElement("th", null, "Last Published")), ContentTree_styled_1.StyledContentTreeTable,
react_1.default.createElement(ContentTreeNode_1.default, { node: stRoot, depth: depth, addChildNodes: addChildNodes, removeChildNodes: removeChildNodes, editEntry: editEntry }))))); null,
}; react_1.default.createElement(
exports.ContentTreeRoot = ContentTreeRoot; 'tbody',
null,
react_1.default.createElement(
'tr',
null,
react_1.default.createElement('th', null, 'Nodes'),
react_1.default.createElement('th', null, 'Content Type'),
react_1.default.createElement('th', null, 'Status'),
react_1.default.createElement('th', null, 'Last Modified'),
react_1.default.createElement('th', null, 'Last Published'),
),
react_1.default.createElement(ContentTreeNode_1.default, {
node: stRoot,
depth: depth,
addChildNodes: addChildNodes,
removeChildNodes: removeChildNodes,
editEntry: editEntry,
}),
),
),
)
}
exports.ContentTreeRoot = ContentTreeRoot

View File

@ -1,4 +1,12 @@
import type { EntryProps, KeyValueMap } from 'contentful-management'; import type { EntryProps, KeyValueMap } from 'contentful-management'
import type { ContentTreeNodeProps } from './ContentTreeNode'; import type { ContentTreeNodeProps } from './ContentTreeNode'
export declare const emptyNodeProps: () => ContentTreeNodeProps; export declare const emptyNodeProps: () => ContentTreeNodeProps
export declare const cfEntriesToNodes: (entries: EntryProps<KeyValueMap>[], titleFields: string[], stLocale: string, locales: string[], nodeContentTypes: string[], iconRegistry?: Record<string, string>, parentId?: string) => ContentTreeNodeProps[]; export declare const cfEntriesToNodes: (
entries: EntryProps<KeyValueMap>[],
titleFields: string[],
stLocale: string,
locales: string[],
nodeContentTypes: string[],
iconRegistry?: Record<string, string>,
parentId?: string,
) => ContentTreeNodeProps[]

View File

@ -1,67 +1,92 @@
"use strict"; 'use strict'
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, '__esModule', { value: true })
exports.cfEntriesToNodes = exports.emptyNodeProps = void 0; exports.cfEntriesToNodes = exports.emptyNodeProps = void 0
var emptyNodeProps = function () { var emptyNodeProps = function () {
return { id: '', name: '', expand: false, parentId: '' }; return { id: '', name: '', expand: false, parentId: '' }
}; }
exports.emptyNodeProps = emptyNodeProps; exports.emptyNodeProps = emptyNodeProps
var cfEntryHasChildren = function (entry, nodeContentTypes, locales) { var cfEntryHasChildren = function (entry, nodeContentTypes, locales) {
var _a; var _a
for (var _i = 0, nodeContentTypes_1 = nodeContentTypes; _i < nodeContentTypes_1.length; _i++) { for (
var nodeContentType = nodeContentTypes_1[_i]; var _i = 0, nodeContentTypes_1 = nodeContentTypes;
_i < nodeContentTypes_1.length;
_i++
) {
var nodeContentType = nodeContentTypes_1[_i]
for (var _b = 0, locales_1 = locales; _b < locales_1.length; _b++) { for (var _b = 0, locales_1 = locales; _b < locales_1.length; _b++) {
var locale = locales_1[_b]; var locale = locales_1[_b]
if ((_a = entry.fields[nodeContentType]) === null || _a === void 0 ? void 0 : _a[locale]) { if (
return true; (_a = entry.fields[nodeContentType]) === null || _a === void 0
? void 0
: _a[locale]
) {
return true
} }
} }
} }
return false; return false
}; }
var cfEntryPublishingStatus = function (entry) { var cfEntryPublishingStatus = function (entry) {
if (!entry.sys.publishedVersion) { if (!entry.sys.publishedVersion) {
return 'draft'; return 'draft'
} }
if (entry.sys.version - entry.sys.publishedVersion === 1) { if (entry.sys.version - entry.sys.publishedVersion === 1) {
return 'published'; return 'published'
} }
return 'changed'; return 'changed'
}; }
var cfEntriesToNodes = function (entries, titleFields, stLocale, locales, nodeContentTypes, iconRegistry, parentId) { var cfEntriesToNodes = function (
entries,
titleFields,
stLocale,
locales,
nodeContentTypes,
iconRegistry,
parentId,
) {
if (entries.length === 0) { if (entries.length === 0) {
return []; return []
} }
var nodeArray = []; var nodeArray = []
entries.forEach(function (entry) { entries.forEach(function (entry) {
var _a; var _a
if (!entry) { if (!entry) {
return; return
} }
var name = ''; var name = ''
for (var _i = 0, titleFields_1 = titleFields; _i < titleFields_1.length; _i++) { for (
var titleField = titleFields_1[_i]; var _i = 0, titleFields_1 = titleFields;
if ((_a = entry.fields[titleField]) === null || _a === void 0 ? void 0 : _a[stLocale]) { _i < titleFields_1.length;
name = entry.fields[titleField][stLocale]; _i++
break; ) {
var titleField = titleFields_1[_i]
if (
(_a = entry.fields[titleField]) === null || _a === void 0
? void 0
: _a[stLocale]
) {
name = entry.fields[titleField][stLocale]
break
} }
} }
if (name === '') { if (name === '') {
name = entry.sys.id; name = entry.sys.id
} }
var node = { var node = {
id: entry.sys.id, id: entry.sys.id,
name: name, name: name,
contentType: entry.sys.contentType.sys.id, contentType: entry.sys.contentType.sys.id,
icon: iconRegistry != null ? iconRegistry[entry.sys.contentType.sys.id] : '', icon:
iconRegistry != null ? iconRegistry[entry.sys.contentType.sys.id] : '',
expand: !!parentId, expand: !!parentId,
parentId: parentId, parentId: parentId,
hasChildNodes: cfEntryHasChildren(entry, nodeContentTypes, locales), hasChildNodes: cfEntryHasChildren(entry, nodeContentTypes, locales),
publishingStatus: cfEntryPublishingStatus(entry), publishingStatus: cfEntryPublishingStatus(entry),
updatedAt: entry.sys.updatedAt, updatedAt: entry.sys.updatedAt,
publishedAt: entry.sys.publishedAt, publishedAt: entry.sys.publishedAt,
}; }
nodeArray.push(node); nodeArray.push(node)
}); })
return nodeArray; return nodeArray
}; }
exports.cfEntriesToNodes = cfEntriesToNodes; exports.cfEntriesToNodes = cfEntriesToNodes

22
dist/Icons.d.ts vendored
View File

@ -1,9 +1,17 @@
import React, { type FC, type ReactElement, type SVGProps } from 'react'; import React, { type FC, type ReactElement, type SVGProps } from 'react'
export type SVGIcon = FC<SVGProps<SVGSVGElement>>; export type SVGIcon = FC<SVGProps<SVGSVGElement>>
export interface IconProps { export interface IconProps {
icon?: SVGIcon; icon?: SVGIcon
} }
export declare const Icon: (props: { export declare const Icon: (props: { id?: string }) => ReactElement
id?: string; export declare const StyledIcon: import('styled-components/dist/types').IStyledComponentBase<
}) => ReactElement; 'web',
export declare const StyledIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string; import('styled-components').FastOmit<
React.DetailedHTMLProps<
React.HTMLAttributes<HTMLSpanElement>,
HTMLSpanElement
>,
never
>
> &
string

338
dist/Icons.js vendored
View File

@ -1,80 +1,278 @@
"use strict"; 'use strict'
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { var __makeTemplateObject =
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } (this && this.__makeTemplateObject) ||
return cooked; function (cooked, raw) {
}; if (Object.defineProperty) {
var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(cooked, 'raw', { value: raw })
return (mod && mod.__esModule) ? mod : { "default": mod }; } else {
}; cooked.raw = raw
Object.defineProperty(exports, "__esModule", { value: true }); }
exports.StyledIcon = exports.Icon = void 0; return cooked
var react_1 = __importDefault(require("react")); }
var styled_components_1 = __importDefault(require("styled-components")); var __importDefault =
(this && this.__importDefault) ||
function (mod) {
return mod && mod.__esModule ? mod : { default: mod }
}
Object.defineProperty(exports, '__esModule', { value: true })
exports.StyledIcon = exports.Icon = void 0
var react_1 = __importDefault(require('react'))
var styled_components_1 = __importDefault(require('styled-components'))
var Icon = function (props) { var Icon = function (props) {
switch (props.id) { switch (props.id) {
case 'WORLD': case 'WORLD':
return (react_1.default.createElement(exports.StyledIcon, null, return react_1.default.createElement(
react_1.default.createElement("svg", { id: "Layer_1", "data-name": "Layer 1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 128 128" }, exports.StyledIcon,
react_1.default.createElement("title", null, "WORLD"), null,
react_1.default.createElement("path", { d: "M113.66,23.69q-.345-.435-.72-.87A63.786,63.786,0,0,0,64.92.02C64.61.01,64.31,0,64,0s-.61.01-.92.02A63.789,63.789,0,0,0,14.93,22.98a6.164,6.164,0,0,0-.47.57.138.138,0,0,1-.03.04,63.8,63.8,0,0,0,0,80.82.138.138,0,0,1,.03.04,6.171,6.171,0,0,0,.47.57l.01.01a63.776,63.776,0,0,0,48.14,22.95c.614.02,1.226.02,1.84,0a63.786,63.786,0,0,0,48.02-22.8q.375-.435.72-.87a63.826,63.826,0,0,0,0-80.62ZM99.49,62.25a106.208,106.208,0,0,0-4.07-28.03,69.57,69.57,0,0,0,16.19-7.51,60.158,60.158,0,0,1,12.86,35.54ZM65.75,3.59c10.69,1.1,19.99,12.14,25.36,28.3a100.612,100.612,0,0,1-25.36,3.58Zm-3.5,31.88a100.612,100.612,0,0,1-25.36-3.58c5.37-16.16,14.67-27.2,25.36-28.3Zm0,3.5V62.25H32.01a104.4,104.4,0,0,1,3.85-27.02A104.159,104.159,0,0,0,62.25,38.97Zm0,26.78V89.03a104.161,104.161,0,0,0-26.39,3.74,104.4,104.4,0,0,1-3.85-27.02Zm0,26.78v31.88c-10.69-1.1-19.99-12.14-25.36-28.3A100.612,100.612,0,0,1,62.25,92.53Zm3.5,0a100.612,100.612,0,0,1,25.36,3.58c-5.37,16.16-14.67,27.2-25.36,28.3Zm0-3.5V65.75H95.99a104.477,104.477,0,0,1-3.85,27.03A103.333,103.333,0,0,0,65.75,89.03Zm0-26.78V38.97a103.33,103.33,0,0,0,26.39-3.75,104.478,104.478,0,0,1,3.85,27.03Zm43.6-38.26A66.171,66.171,0,0,1,94.37,30.9C90.53,19.48,84.76,10.4,77.89,5.11A60.6,60.6,0,0,1,109.35,23.99ZM50.11,5.11C43.24,10.4,37.47,19.48,33.63,30.9A67.031,67.031,0,0,1,18.65,24,60.513,60.513,0,0,1,50.11,5.11ZM16.39,26.7a69.605,69.605,0,0,0,16.19,7.53,106.07,106.07,0,0,0-4.07,28.02H3.53A60.188,60.188,0,0,1,16.39,26.7ZM28.51,65.75a106.069,106.069,0,0,0,4.07,28.02v.01a69.183,69.183,0,0,0-16.19,7.52A60.188,60.188,0,0,1,3.53,65.75ZM18.65,104a67.031,67.031,0,0,1,14.98-6.9c3.84,11.42,9.61,20.5,16.48,25.79A60.514,60.514,0,0,1,18.65,104Zm59.24,18.89c6.87-5.29,12.64-14.37,16.48-25.79a66.169,66.169,0,0,1,14.98,6.91A60.6,60.6,0,0,1,77.89,122.89Zm33.72-21.6a69.573,69.573,0,0,0-16.19-7.51,106.208,106.208,0,0,0,4.07-28.03h24.98A60.158,60.158,0,0,1,111.61,101.29Z" })))); react_1.default.createElement(
'svg',
{
id: 'Layer_1',
'data-name': 'Layer 1',
xmlns: 'http://www.w3.org/2000/svg',
viewBox: '0 0 128 128',
},
react_1.default.createElement('title', null, 'WORLD'),
react_1.default.createElement('path', {
d: 'M113.66,23.69q-.345-.435-.72-.87A63.786,63.786,0,0,0,64.92.02C64.61.01,64.31,0,64,0s-.61.01-.92.02A63.789,63.789,0,0,0,14.93,22.98a6.164,6.164,0,0,0-.47.57.138.138,0,0,1-.03.04,63.8,63.8,0,0,0,0,80.82.138.138,0,0,1,.03.04,6.171,6.171,0,0,0,.47.57l.01.01a63.776,63.776,0,0,0,48.14,22.95c.614.02,1.226.02,1.84,0a63.786,63.786,0,0,0,48.02-22.8q.375-.435.72-.87a63.826,63.826,0,0,0,0-80.62ZM99.49,62.25a106.208,106.208,0,0,0-4.07-28.03,69.57,69.57,0,0,0,16.19-7.51,60.158,60.158,0,0,1,12.86,35.54ZM65.75,3.59c10.69,1.1,19.99,12.14,25.36,28.3a100.612,100.612,0,0,1-25.36,3.58Zm-3.5,31.88a100.612,100.612,0,0,1-25.36-3.58c5.37-16.16,14.67-27.2,25.36-28.3Zm0,3.5V62.25H32.01a104.4,104.4,0,0,1,3.85-27.02A104.159,104.159,0,0,0,62.25,38.97Zm0,26.78V89.03a104.161,104.161,0,0,0-26.39,3.74,104.4,104.4,0,0,1-3.85-27.02Zm0,26.78v31.88c-10.69-1.1-19.99-12.14-25.36-28.3A100.612,100.612,0,0,1,62.25,92.53Zm3.5,0a100.612,100.612,0,0,1,25.36,3.58c-5.37,16.16-14.67,27.2-25.36,28.3Zm0-3.5V65.75H95.99a104.477,104.477,0,0,1-3.85,27.03A103.333,103.333,0,0,0,65.75,89.03Zm0-26.78V38.97a103.33,103.33,0,0,0,26.39-3.75,104.478,104.478,0,0,1,3.85,27.03Zm43.6-38.26A66.171,66.171,0,0,1,94.37,30.9C90.53,19.48,84.76,10.4,77.89,5.11A60.6,60.6,0,0,1,109.35,23.99ZM50.11,5.11C43.24,10.4,37.47,19.48,33.63,30.9A67.031,67.031,0,0,1,18.65,24,60.513,60.513,0,0,1,50.11,5.11ZM16.39,26.7a69.605,69.605,0,0,0,16.19,7.53,106.07,106.07,0,0,0-4.07,28.02H3.53A60.188,60.188,0,0,1,16.39,26.7ZM28.51,65.75a106.069,106.069,0,0,0,4.07,28.02v.01a69.183,69.183,0,0,0-16.19,7.52A60.188,60.188,0,0,1,3.53,65.75ZM18.65,104a67.031,67.031,0,0,1,14.98-6.9c3.84,11.42,9.61,20.5,16.48,25.79A60.514,60.514,0,0,1,18.65,104Zm59.24,18.89c6.87-5.29,12.64-14.37,16.48-25.79a66.169,66.169,0,0,1,14.98,6.91A60.6,60.6,0,0,1,77.89,122.89Zm33.72-21.6a69.573,69.573,0,0,0-16.19-7.51,106.208,106.208,0,0,0,4.07-28.03h24.98A60.158,60.158,0,0,1,111.61,101.29Z',
}),
),
)
case 'PAGE': case 'PAGE':
return (react_1.default.createElement(exports.StyledIcon, null, return react_1.default.createElement(
react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48" }, exports.StyledIcon,
react_1.default.createElement("defs", null), null,
react_1.default.createElement("title", null, "Asset 47ldpi"), react_1.default.createElement(
react_1.default.createElement("g", { id: "Layer_2", "data-name": "Layer 2" }, 'svg',
react_1.default.createElement("g", { id: "layer_1-2", "data-name": "layer 1" }, { xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 48 48' },
react_1.default.createElement("path", { d: "M47,48H1a1,1,0,0,1-1-1V1A1,1,0,0,1,1,0H47a1,1,0,0,1,1,1V47A1,1,0,0,1,47,48ZM2,46H46V2H2Z" }), react_1.default.createElement('defs', null),
react_1.default.createElement("rect", { x: "34", y: "25", width: "8", height: "2" }), react_1.default.createElement('title', null, 'Asset 47ldpi'),
react_1.default.createElement("rect", { x: "22", y: "25", width: "10", height: "2" }), react_1.default.createElement(
react_1.default.createElement("rect", { x: "31", y: "30", width: "7", height: "2" }), 'g',
react_1.default.createElement("rect", { x: "22", y: "30", width: "7", height: "2" }), { id: 'Layer_2', 'data-name': 'Layer 2' },
react_1.default.createElement("rect", { x: "36", y: "35", width: "6", height: "2" }), react_1.default.createElement(
react_1.default.createElement("rect", { x: "22", y: "35", width: "12", height: "2" }), 'g',
react_1.default.createElement("rect", { x: "22", y: "40", width: "9", height: "2" }), { id: 'layer_1-2', 'data-name': 'layer 1' },
react_1.default.createElement("path", { d: "M18,42H7a1,1,0,0,1-1-1V26a1,1,0,0,1,1-1H18a1,1,0,0,1,1,1V41A1,1,0,0,1,18,42ZM8,40h9V27H8Z" }), react_1.default.createElement('path', {
react_1.default.createElement("path", { d: "M41,22H7a1,1,0,0,1-1-1V15a1,1,0,0,1,1-1H41a1,1,0,0,1,1,1v6A1,1,0,0,1,41,22ZM8,20H40V16H8Z" }), d: 'M47,48H1a1,1,0,0,1-1-1V1A1,1,0,0,1,1,0H47a1,1,0,0,1,1,1V47A1,1,0,0,1,47,48ZM2,46H46V2H2Z',
react_1.default.createElement("rect", { x: "4", y: "4", width: "2", height: "2" }), }),
react_1.default.createElement("rect", { x: "8", y: "4", width: "2", height: "2" }), react_1.default.createElement('rect', {
react_1.default.createElement("rect", { x: "12", y: "4", width: "2", height: "2" }), x: '34',
react_1.default.createElement("rect", { x: "1", y: "8", width: "46", height: "2" })))))); y: '25',
width: '8',
height: '2',
}),
react_1.default.createElement('rect', {
x: '22',
y: '25',
width: '10',
height: '2',
}),
react_1.default.createElement('rect', {
x: '31',
y: '30',
width: '7',
height: '2',
}),
react_1.default.createElement('rect', {
x: '22',
y: '30',
width: '7',
height: '2',
}),
react_1.default.createElement('rect', {
x: '36',
y: '35',
width: '6',
height: '2',
}),
react_1.default.createElement('rect', {
x: '22',
y: '35',
width: '12',
height: '2',
}),
react_1.default.createElement('rect', {
x: '22',
y: '40',
width: '9',
height: '2',
}),
react_1.default.createElement('path', {
d: 'M18,42H7a1,1,0,0,1-1-1V26a1,1,0,0,1,1-1H18a1,1,0,0,1,1,1V41A1,1,0,0,1,18,42ZM8,40h9V27H8Z',
}),
react_1.default.createElement('path', {
d: 'M41,22H7a1,1,0,0,1-1-1V15a1,1,0,0,1,1-1H41a1,1,0,0,1,1,1v6A1,1,0,0,1,41,22ZM8,20H40V16H8Z',
}),
react_1.default.createElement('rect', {
x: '4',
y: '4',
width: '2',
height: '2',
}),
react_1.default.createElement('rect', {
x: '8',
y: '4',
width: '2',
height: '2',
}),
react_1.default.createElement('rect', {
x: '12',
y: '4',
width: '2',
height: '2',
}),
react_1.default.createElement('rect', {
x: '1',
y: '8',
width: '46',
height: '2',
}),
),
),
),
)
case 'APP': case 'APP':
return (react_1.default.createElement(exports.StyledIcon, null, return react_1.default.createElement(
react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" }, exports.StyledIcon,
react_1.default.createElement("title", null, "8-Book"), null,
react_1.default.createElement("g", { id: "_8-Book", "data-name": "8-Book" }, react_1.default.createElement(
react_1.default.createElement("path", { d: "M27,23a5,5,0,0,0-3-1H6a5,5,0,0,0-3,1V5A3,3,0,0,1,6,2H18V0H6A5,5,0,0,0,1,5V27a5,5,0,0,0,5,5H28a1,1,0,0,0,1-1V19H27Zm0,7H6a3,3,0,0,1,0-6H24a3,3,0,0,1,2.82,2H10v2H27Z" }), 'svg',
react_1.default.createElement("rect", { x: "6", y: "26", width: "2", height: "2" }), { xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 32 32' },
react_1.default.createElement("path", { d: "M15,7V5H7A1,1,0,0,0,6,6v4a1,1,0,0,0,1,1h8V9H8V7Z" }), react_1.default.createElement('title', null, '8-Book'),
react_1.default.createElement("rect", { x: "6", y: "14", width: "2", height: "2" }), react_1.default.createElement(
react_1.default.createElement("rect", { x: "10", y: "14", width: "2", height: "2" }), 'g',
react_1.default.createElement("path", { d: "M31,11V9H28.9a5,5,0,0,0-.73-1.75l1.54-1.54L28.29,4.29,26.75,5.83A5,5,0,0,0,25,5.1V3H23V5.1a5,5,0,0,0-1.75.73L19.71,4.29,18.29,5.71l1.54,1.54A5,5,0,0,0,19.1,9H17v2h2.1a5,5,0,0,0,.73,1.75l-1.54,1.54,1.41,1.41,1.54-1.54A5,5,0,0,0,23,14.9V17h2V14.9a5,5,0,0,0,1.75-.73l1.54,1.54,1.41-1.41-1.54-1.54A5,5,0,0,0,28.9,11Zm-7,2a3,3,0,1,1,3-3A3,3,0,0,1,24,13Z" }))))); { id: '_8-Book', 'data-name': '8-Book' },
react_1.default.createElement('path', {
d: 'M27,23a5,5,0,0,0-3-1H6a5,5,0,0,0-3,1V5A3,3,0,0,1,6,2H18V0H6A5,5,0,0,0,1,5V27a5,5,0,0,0,5,5H28a1,1,0,0,0,1-1V19H27Zm0,7H6a3,3,0,0,1,0-6H24a3,3,0,0,1,2.82,2H10v2H27Z',
}),
react_1.default.createElement('rect', {
x: '6',
y: '26',
width: '2',
height: '2',
}),
react_1.default.createElement('path', {
d: 'M15,7V5H7A1,1,0,0,0,6,6v4a1,1,0,0,0,1,1h8V9H8V7Z',
}),
react_1.default.createElement('rect', {
x: '6',
y: '14',
width: '2',
height: '2',
}),
react_1.default.createElement('rect', {
x: '10',
y: '14',
width: '2',
height: '2',
}),
react_1.default.createElement('path', {
d: 'M31,11V9H28.9a5,5,0,0,0-.73-1.75l1.54-1.54L28.29,4.29,26.75,5.83A5,5,0,0,0,25,5.1V3H23V5.1a5,5,0,0,0-1.75.73L19.71,4.29,18.29,5.71l1.54,1.54A5,5,0,0,0,19.1,9H17v2h2.1a5,5,0,0,0,.73,1.75l-1.54,1.54,1.41,1.41,1.54-1.54A5,5,0,0,0,23,14.9V17h2V14.9a5,5,0,0,0,1.75-.73l1.54,1.54,1.41-1.41-1.54-1.54A5,5,0,0,0,28.9,11Zm-7,2a3,3,0,1,1,3-3A3,3,0,0,1,24,13Z',
}),
),
),
)
case 'CART': case 'CART':
return (react_1.default.createElement(exports.StyledIcon, null, return react_1.default.createElement(
react_1.default.createElement("svg", { version: "1.1", id: "shopping_x5F_carts_1_", xmlns: "http://www.w3.org/2000/svg", x: "0", y: "0", viewBox: "0 0 128 128" }, exports.StyledIcon,
react_1.default.createElement("g", { id: "_x31__1_" }, null,
react_1.default.createElement("path", { d: "M92.1 96c-5.2 0-9.3 4.2-9.3 9.3 0 5.2 4.2 9.3 9.3 9.3s9.3-4.2 9.3-9.3c0-5.1-4.1-9.3-9.3-9.3zm0 16a6.7 6.7 0 1 1 6.7-6.7c0 3.8-3 6.7-6.7 6.7zM41.4 96c-5.2 0-9.3 4.2-9.3 9.3 0 5.2 4.2 9.3 9.3 9.3s9.3-4.2 9.3-9.3c0-5.1-4.2-9.3-9.3-9.3zm0 16a6.7 6.7 0 1 1 6.7-6.7c0 3.8-3 6.7-6.7 6.7zm86.2-73.5c-.5-.8-1.3-1.2-2.2-1.2h-102L19 15.4c-.3-1.2-1.3-2.1-2.6-2.1H2.7C1.2 13.3 0 14.5 0 16c0 1.5 1.2 2.7 2.7 2.7h11.4l14.6 72.6c.3 1.2 1.3 2.1 2.6 2.1h72.2c1.1 0 2-.6 2.4-1.6L127.8 41c.3-.8.3-1.7-.2-2.5zM101.7 88H33.5l-2.7-13.3h76.7L101.7 88zm6.9-16H30.3l-2.7-13.3h86.8L108.6 72zm6.9-16H27l-2.7-13.3h96.9L115.5 56z", id: "icon_14_" }))))); react_1.default.createElement(
'svg',
{
version: '1.1',
id: 'shopping_x5F_carts_1_',
xmlns: 'http://www.w3.org/2000/svg',
x: '0',
y: '0',
viewBox: '0 0 128 128',
},
react_1.default.createElement(
'g',
{ id: '_x31__1_' },
react_1.default.createElement('path', {
d: 'M92.1 96c-5.2 0-9.3 4.2-9.3 9.3 0 5.2 4.2 9.3 9.3 9.3s9.3-4.2 9.3-9.3c0-5.1-4.1-9.3-9.3-9.3zm0 16a6.7 6.7 0 1 1 6.7-6.7c0 3.8-3 6.7-6.7 6.7zM41.4 96c-5.2 0-9.3 4.2-9.3 9.3 0 5.2 4.2 9.3 9.3 9.3s9.3-4.2 9.3-9.3c0-5.1-4.2-9.3-9.3-9.3zm0 16a6.7 6.7 0 1 1 6.7-6.7c0 3.8-3 6.7-6.7 6.7zm86.2-73.5c-.5-.8-1.3-1.2-2.2-1.2h-102L19 15.4c-.3-1.2-1.3-2.1-2.6-2.1H2.7C1.2 13.3 0 14.5 0 16c0 1.5 1.2 2.7 2.7 2.7h11.4l14.6 72.6c.3 1.2 1.3 2.1 2.6 2.1h72.2c1.1 0 2-.6 2.4-1.6L127.8 41c.3-.8.3-1.7-.2-2.5zM101.7 88H33.5l-2.7-13.3h76.7L101.7 88zm6.9-16H30.3l-2.7-13.3h86.8L108.6 72zm6.9-16H27l-2.7-13.3h96.9L115.5 56z',
id: 'icon_14_',
}),
),
),
)
case 'FOLDER': case 'FOLDER':
return (react_1.default.createElement(exports.StyledIcon, null, return react_1.default.createElement(
react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 64 64" }, exports.StyledIcon,
react_1.default.createElement("path", { d: "M64 15v37a5.006 5.006 0 0 1-5 5H5a5.006 5.006 0 0 1-5-5V12a5.006 5.006 0 0 1 5-5h14.116a6.966 6.966 0 0 1 5.466 2.627l5 6.247A2.983 2.983 0 0 0 31.922 17H59a1 1 0 0 1 0 2H31.922a4.979 4.979 0 0 1-3.9-1.876l-5-6.247A4.976 4.976 0 0 0 19.116 9H5a3 3 0 0 0-3 3v40a3 3 0 0 0 3 3h54a3 3 0 0 0 3-3V15a3 3 0 0 0-3-3H30a1 1 0 0 1 0-2h29a5.006 5.006 0 0 1 5 5z" })))); null,
react_1.default.createElement(
'svg',
{ xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 64 64' },
react_1.default.createElement('path', {
d: 'M64 15v37a5.006 5.006 0 0 1-5 5H5a5.006 5.006 0 0 1-5-5V12a5.006 5.006 0 0 1 5-5h14.116a6.966 6.966 0 0 1 5.466 2.627l5 6.247A2.983 2.983 0 0 0 31.922 17H59a1 1 0 0 1 0 2H31.922a4.979 4.979 0 0 1-3.9-1.876l-5-6.247A4.976 4.976 0 0 0 19.116 9H5a3 3 0 0 0-3 3v40a3 3 0 0 0 3 3h54a3 3 0 0 0 3-3V15a3 3 0 0 0-3-3H30a1 1 0 0 1 0-2h29a5.006 5.006 0 0 1 5 5z',
}),
),
)
case 'LOVE': case 'LOVE':
return (react_1.default.createElement(exports.StyledIcon, null, return react_1.default.createElement(
react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, exports.StyledIcon,
react_1.default.createElement("path", { d: "M22.813 7.338a6.736 6.736 0 0 0-3.8-4.49c-3.206-1.471-6 .878-7.016 1.9-1.013-1.025-3.813-3.374-7.016-1.9a6.736 6.736 0 0 0-3.8 4.49 5.818 5.818 0 0 0 1 4.98c1.708 2.215 9.156 8.891 9.472 9.174a.514.514 0 0 0 .688 0c.316-.283 7.764-6.959 9.472-9.174a5.815 5.815 0 0 0 1-4.98zM21 11.689c-1.448 1.878-7.488 7.362-9 8.726-1.512-1.364-7.552-6.848-9-8.726a4.8 4.8 0 0 1-.812-4.1 5.711 5.711 0 0 1 3.226-3.8c2.229-1.027 4.731.311 6.186 2.05a.516.516 0 0 0 .4.188.516.516 0 0 0 .4-.188c.029-.035 2.958-3.536 6.188-2.055a5.714 5.714 0 0 1 3.226 3.8A4.8 4.8 0 0 1 21 11.689z" }), null,
react_1.default.createElement("path", { d: "M6.346 5a4.39 4.39 0 0 0-2.473 2.928 3.818 3.818 0 0 0 .656 3.272.515.515 0 0 0 .816-.629 2.8 2.8 0 0 1-.472-2.392 3.366 3.366 0 0 1 1.9-2.237A.515.515 0 0 0 6.346 5z" })))); react_1.default.createElement(
'svg',
{ xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 24 24' },
react_1.default.createElement('path', {
d: 'M22.813 7.338a6.736 6.736 0 0 0-3.8-4.49c-3.206-1.471-6 .878-7.016 1.9-1.013-1.025-3.813-3.374-7.016-1.9a6.736 6.736 0 0 0-3.8 4.49 5.818 5.818 0 0 0 1 4.98c1.708 2.215 9.156 8.891 9.472 9.174a.514.514 0 0 0 .688 0c.316-.283 7.764-6.959 9.472-9.174a5.815 5.815 0 0 0 1-4.98zM21 11.689c-1.448 1.878-7.488 7.362-9 8.726-1.512-1.364-7.552-6.848-9-8.726a4.8 4.8 0 0 1-.812-4.1 5.711 5.711 0 0 1 3.226-3.8c2.229-1.027 4.731.311 6.186 2.05a.516.516 0 0 0 .4.188.516.516 0 0 0 .4-.188c.029-.035 2.958-3.536 6.188-2.055a5.714 5.714 0 0 1 3.226 3.8A4.8 4.8 0 0 1 21 11.689z',
}),
react_1.default.createElement('path', {
d: 'M6.346 5a4.39 4.39 0 0 0-2.473 2.928 3.818 3.818 0 0 0 .656 3.272.515.515 0 0 0 .816-.629 2.8 2.8 0 0 1-.472-2.392 3.366 3.366 0 0 1 1.9-2.237A.515.515 0 0 0 6.346 5z',
}),
),
)
case 'SHORTCUT': case 'SHORTCUT':
return (react_1.default.createElement(exports.StyledIcon, null, return react_1.default.createElement(
react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, exports.StyledIcon,
react_1.default.createElement("g", { "data-name": "13.Arrow up" }, null,
react_1.default.createElement("path", { d: "M12 24a12 12 0 1 1 12-12 12.013 12.013 0 0 1-12 12zm0-22a10 10 0 1 0 10 10A10.011 10.011 0 0 0 12 2z" }), react_1.default.createElement(
react_1.default.createElement("path", { d: "M18 12h-2V9h-4V7h6v5z" }), 'svg',
react_1.default.createElement("path", { d: "m3.707 17.707-1.414-1.414L6.586 12h5l4.707-4.707 1.414 1.414L12.414 14h-5l-3.707 3.707z" }))))); { xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 24 24' },
react_1.default.createElement(
'g',
{ 'data-name': '13.Arrow up' },
react_1.default.createElement('path', {
d: 'M12 24a12 12 0 1 1 12-12 12.013 12.013 0 0 1-12 12zm0-22a10 10 0 1 0 10 10A10.011 10.011 0 0 0 12 2z',
}),
react_1.default.createElement('path', {
d: 'M18 12h-2V9h-4V7h6v5z',
}),
react_1.default.createElement('path', {
d: 'm3.707 17.707-1.414-1.414L6.586 12h5l4.707-4.707 1.414 1.414L12.414 14h-5l-3.707 3.707z',
}),
),
),
)
} }
return (react_1.default.createElement(exports.StyledIcon, null, return react_1.default.createElement(
react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20.088", height: "20.087" }, exports.StyledIcon,
react_1.default.createElement("path", { d: "M10.044 0a10.044 10.044 0 1 0 10.044 10.043A10.043 10.043 0 0 0 10.044 0zm.047 15.033a4.99 4.99 0 1 1 4.99-4.99 4.989 4.989 0 0 1-4.99 4.99z" })))); null,
}; react_1.default.createElement(
exports.Icon = Icon; 'svg',
exports.StyledIcon = styled_components_1.default.span(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tline-height: 1px;\n\tposition: relative;\n\tdisplay: inline-block;\n\tvertical-align: top;\n\twidth: 16px;\n\theight: 16px;\n\tmargin: 2px 4px;\n"], ["\n\tline-height: 1px;\n\tposition: relative;\n\tdisplay: inline-block;\n\tvertical-align: top;\n\twidth: 16px;\n\theight: 16px;\n\tmargin: 2px 4px;\n"]))); {
var templateObject_1; xmlns: 'http://www.w3.org/2000/svg',
width: '20.088',
height: '20.087',
},
react_1.default.createElement('path', {
d: 'M10.044 0a10.044 10.044 0 1 0 10.044 10.043A10.043 10.043 0 0 0 10.044 0zm.047 15.033a4.99 4.99 0 1 1 4.99-4.99 4.989 4.989 0 0 1-4.99 4.99z',
}),
),
)
}
exports.Icon = Icon
exports.StyledIcon = styled_components_1.default.span(
templateObject_1 ||
(templateObject_1 = __makeTemplateObject(
[
'\n\tline-height: 1px;\n\tposition: relative;\n\tdisplay: inline-block;\n\tvertical-align: top;\n\twidth: 16px;\n\theight: 16px;\n\tmargin: 2px 4px;\n',
],
[
'\n\tline-height: 1px;\n\tposition: relative;\n\tdisplay: inline-block;\n\tvertical-align: top;\n\twidth: 16px;\n\theight: 16px;\n\tmargin: 2px 4px;\n',
],
)),
)
var templateObject_1

6
dist/index.d.ts vendored
View File

@ -1,3 +1,3 @@
export * from './ContentTree'; export * from './ContentTree'
export * from './ContentTree.styled'; export * from './ContentTree.styled'
export * from './ContentTreeNode'; export * from './ContentTreeNode'

52
dist/index.js vendored
View File

@ -1,19 +1,35 @@
"use strict"; 'use strict'
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding =
if (k2 === undefined) k2 = k; (this && this.__createBinding) ||
var desc = Object.getOwnPropertyDescriptor(m, k); (Object.create
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { ? function (o, m, k, k2) {
desc = { enumerable: true, get: function() { return m[k]; } }; if (k2 === undefined) k2 = k
var desc = Object.getOwnPropertyDescriptor(m, k)
if (
!desc ||
('get' in desc ? !m.__esModule : desc.writable || desc.configurable)
) {
desc = {
enumerable: true,
get: function () {
return m[k]
},
} }
Object.defineProperty(o, k2, desc); }
}) : (function(o, m, k, k2) { Object.defineProperty(o, k2, desc)
if (k2 === undefined) k2 = k; }
o[k2] = m[k]; : function (o, m, k, k2) {
})); if (k2 === undefined) k2 = k
var __exportStar = (this && this.__exportStar) || function(m, exports) { o[k2] = m[k]
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); })
}; var __exportStar =
Object.defineProperty(exports, "__esModule", { value: true }); (this && this.__exportStar) ||
__exportStar(require("./ContentTree"), exports); function (m, exports) {
__exportStar(require("./ContentTree.styled"), exports); for (var p in m)
__exportStar(require("./ContentTreeNode"), exports); if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p))
__createBinding(exports, m, p)
}
Object.defineProperty(exports, '__esModule', { value: true })
__exportStar(require('./ContentTree'), exports)
__exportStar(require('./ContentTree.styled'), exports)
__exportStar(require('./ContentTreeNode'), exports)

View File

@ -6,27 +6,24 @@
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"clean": "rm -f ./tsconfig.tsbuildinfo && rm -rvf dist", "clean": "rm -f ./tsconfig.tsbuildinfo && rm -rvf dist",
"build": "tsc -b -v", "build": "tsc -b",
"rebuild": "pnpm clean && pnpm build", "rebuild": "pnpm clean && pnpm build",
"dev": "pnpm tsc -b tsconfig.json -w", "dev": "pnpm tsc -b tsconfig.json -w",
"lint": "biome check --write ." "lint": "biome check --write ."
}, },
"devDependencies": { "devDependencies": {
"@biomejs/biome": "2.1.3", "@biomejs/biome": "2.1.4",
"@types/react": "19.1.9", "@types/react": "19.1.10",
"@types/styled-components": "5.1.34", "@types/styled-components": "5.1.34",
"install-peers": "1.0.4", "install-peers": "1.0.4",
"typescript": "5.9.2" "typescript": "5.9.2"
}, },
"peerDependencies": {
"install-peers": "1.0.4"
},
"optionalDependencies": { "optionalDependencies": {
"react": "19.1.1", "react": "19.1.1",
"styled-components": "6.1.19" "styled-components": "6.1.19"
}, },
"dependencies": { "dependencies": {
"contentful-management": "11.54.4", "contentful-management": "11.54.4",
"contentful-ui-extensions-sdk": "4.37.0" "contentful-ui-extensions-sdk": "4.41.0"
} }
} }

View File

@ -12,15 +12,15 @@ importers:
specifier: 11.54.4 specifier: 11.54.4
version: 11.54.4 version: 11.54.4
contentful-ui-extensions-sdk: contentful-ui-extensions-sdk:
specifier: 4.37.0 specifier: 4.41.0
version: 4.37.0 version: 4.41.0
devDependencies: devDependencies:
'@biomejs/biome': '@biomejs/biome':
specifier: 2.1.3 specifier: 2.1.4
version: 2.1.3 version: 2.1.4
'@types/react': '@types/react':
specifier: 19.1.9 specifier: 19.1.10
version: 19.1.9 version: 19.1.10
'@types/styled-components': '@types/styled-components':
specifier: 5.1.34 specifier: 5.1.34
version: 5.1.34 version: 5.1.34
@ -40,55 +40,55 @@ importers:
packages: packages:
'@biomejs/biome@2.1.3': '@biomejs/biome@2.1.4':
resolution: {integrity: sha512-KE/tegvJIxTkl7gJbGWSgun7G6X/n2M6C35COT6ctYrAy7SiPyNvi6JtoQERVK/VRbttZfgGq96j2bFmhmnH4w==} resolution: {integrity: sha512-QWlrqyxsU0FCebuMnkvBIkxvPqH89afiJzjMl+z67ybutse590jgeaFdDurE9XYtzpjRGTI1tlUZPGWmbKsElA==}
engines: {node: '>=14.21.3'} engines: {node: '>=14.21.3'}
hasBin: true hasBin: true
'@biomejs/cli-darwin-arm64@2.1.3': '@biomejs/cli-darwin-arm64@2.1.4':
resolution: {integrity: sha512-LFLkSWRoSGS1wVUD/BE6Nlt2dSn0ulH3XImzg2O/36BoToJHKXjSxzPEMAqT9QvwVtk7/9AQhZpTneERU9qaXA==} resolution: {integrity: sha512-sCrNENE74I9MV090Wq/9Dg7EhPudx3+5OiSoQOkIe3DLPzFARuL1dOwCWhKCpA3I5RHmbrsbNSRfZwCabwd8Qg==}
engines: {node: '>=14.21.3'} engines: {node: '>=14.21.3'}
cpu: [arm64] cpu: [arm64]
os: [darwin] os: [darwin]
'@biomejs/cli-darwin-x64@2.1.3': '@biomejs/cli-darwin-x64@2.1.4':
resolution: {integrity: sha512-Q/4OTw8P9No9QeowyxswcWdm0n2MsdCwWcc5NcKQQvzwPjwuPdf8dpPPf4r+x0RWKBtl1FLiAUtJvBlri6DnYw==} resolution: {integrity: sha512-gOEICJbTCy6iruBywBDcG4X5rHMbqCPs3clh3UQ+hRKlgvJTk4NHWQAyHOXvaLe+AxD1/TNX1jbZeffBJzcrOw==}
engines: {node: '>=14.21.3'} engines: {node: '>=14.21.3'}
cpu: [x64] cpu: [x64]
os: [darwin] os: [darwin]
'@biomejs/cli-linux-arm64-musl@2.1.3': '@biomejs/cli-linux-arm64-musl@2.1.4':
resolution: {integrity: sha512-KXouFSBnoxAWZYDQrnNRzZBbt5s9UJkIm40hdvSL9mBxSSoxRFQJbtg1hP3aa8A2SnXyQHxQfpiVeJlczZt76w==} resolution: {integrity: sha512-nYr7H0CyAJPaLupFE2cH16KZmRC5Z9PEftiA2vWxk+CsFkPZQ6dBRdcC6RuS+zJlPc/JOd8xw3uCCt9Pv41WvQ==}
engines: {node: '>=14.21.3'} engines: {node: '>=14.21.3'}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
'@biomejs/cli-linux-arm64@2.1.3': '@biomejs/cli-linux-arm64@2.1.4':
resolution: {integrity: sha512-2hS6LgylRqMFmAZCOFwYrf77QMdUwJp49oe8PX/O8+P2yKZMSpyQTf3Eo5ewnsMFUEmYbPOskafdV1ds1MZMJA==} resolution: {integrity: sha512-juhEkdkKR4nbUi5k/KRp1ocGPNWLgFRD4NrHZSveYrD6i98pyvuzmS9yFYgOZa5JhaVqo0HPnci0+YuzSwT2fw==}
engines: {node: '>=14.21.3'} engines: {node: '>=14.21.3'}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
'@biomejs/cli-linux-x64-musl@2.1.3': '@biomejs/cli-linux-x64-musl@2.1.4':
resolution: {integrity: sha512-KaLAxnROouzIWtl6a0Y88r/4hW5oDUJTIqQorOTVQITaKQsKjZX4XCUmHIhdEk8zMnaiLZzRTAwk1yIAl+mIew==} resolution: {integrity: sha512-lvwvb2SQQHctHUKvBKptR6PLFCM7JfRjpCCrDaTmvB7EeZ5/dQJPhTYBf36BE/B4CRWR2ZiBLRYhK7hhXBCZAg==}
engines: {node: '>=14.21.3'} engines: {node: '>=14.21.3'}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
'@biomejs/cli-linux-x64@2.1.3': '@biomejs/cli-linux-x64@2.1.4':
resolution: {integrity: sha512-NxlSCBhLvQtWGagEztfAZ4WcE1AkMTntZV65ZvR+J9jp06+EtOYEBPQndA70ZGhHbEDG57bR6uNvqkd1WrEYVA==} resolution: {integrity: sha512-Eoy9ycbhpJVYuR+LskV9s3uyaIkp89+qqgqhGQsWnp/I02Uqg2fXFblHJOpGZR8AxdB9ADy87oFVxn9MpFKUrw==}
engines: {node: '>=14.21.3'} engines: {node: '>=14.21.3'}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
'@biomejs/cli-win32-arm64@2.1.3': '@biomejs/cli-win32-arm64@2.1.4':
resolution: {integrity: sha512-V9CUZCtWH4u0YwyCYbQ3W5F4ZGPWp2C2TYcsiWFNNyRfmOW1j/TY/jAurl33SaRjgZPO5UUhGyr9m6BN9t84NQ==} resolution: {integrity: sha512-3WRYte7orvyi6TRfIZkDN9Jzoogbv+gSvR+b9VOXUg1We1XrjBg6WljADeVEaKTvOcpVdH0a90TwyOQ6ue4fGw==}
engines: {node: '>=14.21.3'} engines: {node: '>=14.21.3'}
cpu: [arm64] cpu: [arm64]
os: [win32] os: [win32]
'@biomejs/cli-win32-x64@2.1.3': '@biomejs/cli-win32-x64@2.1.4':
resolution: {integrity: sha512-dxy599q6lgp8ANPpR8sDMscwdp9oOumEsVXuVCVT9N2vAho8uYXlCz53JhxX6LtJOXaE73qzgkGQ7QqvFlMC0g==} resolution: {integrity: sha512-tBc+W7anBPSFXGAoQW+f/+svkpt8/uXfRwDzN1DvnatkRMt16KIYpEi/iw8u9GahJlFv98kgHcIrSsZHZTR0sw==}
engines: {node: '>=14.21.3'} engines: {node: '>=14.21.3'}
cpu: [x64] cpu: [x64]
os: [win32] os: [win32]
@ -114,8 +114,8 @@ packages:
'@types/hoist-non-react-statics@3.3.5': '@types/hoist-non-react-statics@3.3.5':
resolution: {integrity: sha512-SbcrWzkKBw2cdwRTwQAswfpB9g9LJWfjtUeW/jvNwbhC8cpmmNYVePa+ncbUe0rGTQ7G3Ff6mYUN2VMfLVr+Sg==} resolution: {integrity: sha512-SbcrWzkKBw2cdwRTwQAswfpB9g9LJWfjtUeW/jvNwbhC8cpmmNYVePa+ncbUe0rGTQ7G3Ff6mYUN2VMfLVr+Sg==}
'@types/react@19.1.9': '@types/react@19.1.10':
resolution: {integrity: sha512-WmdoynAX8Stew/36uTSVMcLJJ1KRh6L3IZRx1PZ7qJtBqT3dYTgyDTx8H1qoRghErydW7xw9mSJ3wS//tCRpFA==} resolution: {integrity: sha512-EhBeSYX0Y6ye8pNebpKrwFJq7BoQ8J5SO6NlvNwwHjSj6adXJViPQrKlsyPw7hLBLvckEMO1yxeGdR82YBBlDg==}
'@types/styled-components@5.1.34': '@types/styled-components@5.1.34':
resolution: {integrity: sha512-mmiVvwpYklFIv9E8qfxuPyIt/OuyIrn6gMOAMOFUO3WJfSrSE+sGUoa4PiZj77Ut7bKZpaa6o1fBKS/4TOEvnA==} resolution: {integrity: sha512-mmiVvwpYklFIv9E8qfxuPyIt/OuyIrn6gMOAMOFUO3WJfSrSE+sGUoa4PiZj77Ut7bKZpaa6o1fBKS/4TOEvnA==}
@ -152,8 +152,8 @@ packages:
resolution: {integrity: sha512-cUvHbC2u8ouJHhG3tofQhUc0FAmM/QBcalYjiczMtFKrR77BW+eSPcPg+A9DQlhIP0UGcQ/knXxoJpBvrERXTA==} resolution: {integrity: sha512-cUvHbC2u8ouJHhG3tofQhUc0FAmM/QBcalYjiczMtFKrR77BW+eSPcPg+A9DQlhIP0UGcQ/knXxoJpBvrERXTA==}
engines: {node: '>=18'} engines: {node: '>=18'}
contentful-ui-extensions-sdk@4.37.0: contentful-ui-extensions-sdk@4.41.0:
resolution: {integrity: sha512-uZVKOBO5T+ZsicKhaZhWuiUJaAJxGe8cs4MLAu5Bhkzl/Wtiyv0Tp47pEabtIbix0hAepYm60qspVW+i7rOxRA==} resolution: {integrity: sha512-0aLuDXPSMAfA3NkSUKb0Eo4sGpYcNnD/gXyJx7knkNJ5Q4v5wiUo66c+WCNOwUmC2GJPHrL5I1vazqmNIAo9Ww==}
css-color-keywords@1.0.0: css-color-keywords@1.0.0:
resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==}
@ -360,39 +360,39 @@ packages:
snapshots: snapshots:
'@biomejs/biome@2.1.3': '@biomejs/biome@2.1.4':
optionalDependencies: optionalDependencies:
'@biomejs/cli-darwin-arm64': 2.1.3 '@biomejs/cli-darwin-arm64': 2.1.4
'@biomejs/cli-darwin-x64': 2.1.3 '@biomejs/cli-darwin-x64': 2.1.4
'@biomejs/cli-linux-arm64': 2.1.3 '@biomejs/cli-linux-arm64': 2.1.4
'@biomejs/cli-linux-arm64-musl': 2.1.3 '@biomejs/cli-linux-arm64-musl': 2.1.4
'@biomejs/cli-linux-x64': 2.1.3 '@biomejs/cli-linux-x64': 2.1.4
'@biomejs/cli-linux-x64-musl': 2.1.3 '@biomejs/cli-linux-x64-musl': 2.1.4
'@biomejs/cli-win32-arm64': 2.1.3 '@biomejs/cli-win32-arm64': 2.1.4
'@biomejs/cli-win32-x64': 2.1.3 '@biomejs/cli-win32-x64': 2.1.4
'@biomejs/cli-darwin-arm64@2.1.3': '@biomejs/cli-darwin-arm64@2.1.4':
optional: true optional: true
'@biomejs/cli-darwin-x64@2.1.3': '@biomejs/cli-darwin-x64@2.1.4':
optional: true optional: true
'@biomejs/cli-linux-arm64-musl@2.1.3': '@biomejs/cli-linux-arm64-musl@2.1.4':
optional: true optional: true
'@biomejs/cli-linux-arm64@2.1.3': '@biomejs/cli-linux-arm64@2.1.4':
optional: true optional: true
'@biomejs/cli-linux-x64-musl@2.1.3': '@biomejs/cli-linux-x64-musl@2.1.4':
optional: true optional: true
'@biomejs/cli-linux-x64@2.1.3': '@biomejs/cli-linux-x64@2.1.4':
optional: true optional: true
'@biomejs/cli-win32-arm64@2.1.3': '@biomejs/cli-win32-arm64@2.1.4':
optional: true optional: true
'@biomejs/cli-win32-x64@2.1.3': '@biomejs/cli-win32-x64@2.1.4':
optional: true optional: true
'@contentful/rich-text-types@16.8.5': {} '@contentful/rich-text-types@16.8.5': {}
@ -413,17 +413,17 @@ snapshots:
'@types/hoist-non-react-statics@3.3.5': '@types/hoist-non-react-statics@3.3.5':
dependencies: dependencies:
'@types/react': 19.1.9 '@types/react': 19.1.10
hoist-non-react-statics: 3.3.2 hoist-non-react-statics: 3.3.2
'@types/react@19.1.9': '@types/react@19.1.10':
dependencies: dependencies:
csstype: 3.1.3 csstype: 3.1.3
'@types/styled-components@5.1.34': '@types/styled-components@5.1.34':
dependencies: dependencies:
'@types/hoist-non-react-statics': 3.3.5 '@types/hoist-non-react-statics': 3.3.5
'@types/react': 19.1.9 '@types/react': 19.1.10
csstype: 3.1.3 csstype: 3.1.3
'@types/stylis@4.2.5': '@types/stylis@4.2.5':
@ -476,7 +476,7 @@ snapshots:
optionalDependencies: optionalDependencies:
'@rollup/rollup-linux-x64-gnu': 4.46.1 '@rollup/rollup-linux-x64-gnu': 4.46.1
contentful-ui-extensions-sdk@4.37.0: contentful-ui-extensions-sdk@4.41.0:
dependencies: dependencies:
contentful-management: 11.54.4 contentful-management: 11.54.4
transitivePeerDependencies: transitivePeerDependencies:

View File

@ -4,11 +4,7 @@
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"removeComments": true, "removeComments": true,
"target": "es5", "target": "es5",
"lib": [ "lib": ["dom", "dom.iterable", "esnext"],
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true, "allowJs": true,
"skipLibCheck": true, "skipLibCheck": true,
"noEmit": false, "noEmit": false,
@ -23,12 +19,8 @@
"declaration": true, "declaration": true,
"incremental": true, "incremental": true,
"tsBuildInfoFile": "./tsconfig.tsbuildinfo", "tsBuildInfoFile": "./tsconfig.tsbuildinfo",
"composite": true, "composite": true
}, },
"exclude": [ "exclude": ["node_modules"],
"node_modules" "include": ["src"]
],
"include": [
"src"
]
} }