removed dependency of @shin-chan/kypes.
This commit is contained in:
10
.cspell.json
10
.cspell.json
@@ -15,11 +15,19 @@
|
|||||||
"officedocument",
|
"officedocument",
|
||||||
"OKUMURA",
|
"OKUMURA",
|
||||||
"openxmlformats",
|
"openxmlformats",
|
||||||
|
"pcss",
|
||||||
"pizzip",
|
"pizzip",
|
||||||
"rspack",
|
"rspack",
|
||||||
|
"styl",
|
||||||
"SUBTABLE",
|
"SUBTABLE",
|
||||||
"wordprocessingml",
|
"wordprocessingml",
|
||||||
"Yoshihiro"
|
"Yoshihiro"
|
||||||
],
|
],
|
||||||
"ignorePaths": [".env", "dist", "node_modules", "scripts", "plugin"]
|
"ignorePaths": [
|
||||||
|
".env",
|
||||||
|
"dist",
|
||||||
|
"node_modules",
|
||||||
|
"scripts",
|
||||||
|
"plugin"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
@@ -1,17 +0,0 @@
|
|||||||
import presetsPrettier from '@cybozu/eslint-config/flat/presets/react-typescript-prettier.js';
|
|
||||||
import globals from 'globals';
|
|
||||||
|
|
||||||
/** @type {import("eslint").Linter.Config[]} */
|
|
||||||
export default [
|
|
||||||
...presetsPrettier,
|
|
||||||
{
|
|
||||||
languageOptions: {
|
|
||||||
globals: {
|
|
||||||
...globals.node,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
'spaced-comment': ['error', 'always', { markers: ['/'] }],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
|
24
package-lock.json
generated
24
package-lock.json
generated
@@ -30,7 +30,6 @@
|
|||||||
"@kintone/webpack-plugin-kintone-plugin": "^8.0.11",
|
"@kintone/webpack-plugin-kintone-plugin": "^8.0.11",
|
||||||
"@rspack/cli": "^1.5.8",
|
"@rspack/cli": "^1.5.8",
|
||||||
"@rspack/core": "^1.5.8",
|
"@rspack/core": "^1.5.8",
|
||||||
"@shin-chan/kypes": "^0.0.7",
|
|
||||||
"@types/file-saver": "^2.0.7",
|
"@types/file-saver": "^2.0.7",
|
||||||
"@types/node": "^24.6.0",
|
"@types/node": "^24.6.0",
|
||||||
"@types/react": "^19.1.16",
|
"@types/react": "^19.1.16",
|
||||||
@@ -2210,29 +2209,6 @@
|
|||||||
"node": ">=16.0.0"
|
"node": ">=16.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@shin-chan/kypes": {
|
|
||||||
"version": "0.0.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/@shin-chan/kypes/-/kypes-0.0.7.tgz",
|
|
||||||
"integrity": "sha512-2GapEDTz4OX2MUeZwkWyTBuWZXhHZ62D91RxV7iW2083xiBlCiyg/kc4caXhOZIiWC3LNdLUC7ZqxgjqqfaePg==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"@shin-chan/kypes-rest": "^0.0.4"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=16.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@shin-chan/kypes-rest": {
|
|
||||||
"version": "0.0.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/@shin-chan/kypes-rest/-/kypes-rest-0.0.4.tgz",
|
|
||||||
"integrity": "sha512-5JrOdSlvRuxlLJqzcj06nroosTm4NpVxHHgwR2MQauppSRBIEUaXirqyBbTDzUzrR0cp8kW8EVLKMxGM1LJKGg==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=16.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@stylistic/eslint-plugin-ts": {
|
"node_modules/@stylistic/eslint-plugin-ts": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-ts/-/eslint-plugin-ts-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-ts/-/eslint-plugin-ts-3.1.0.tgz",
|
||||||
|
@@ -38,7 +38,6 @@
|
|||||||
"@kintone/webpack-plugin-kintone-plugin": "^8.0.11",
|
"@kintone/webpack-plugin-kintone-plugin": "^8.0.11",
|
||||||
"@rspack/cli": "^1.5.8",
|
"@rspack/cli": "^1.5.8",
|
||||||
"@rspack/core": "^1.5.8",
|
"@rspack/core": "^1.5.8",
|
||||||
"@shin-chan/kypes": "^0.0.7",
|
|
||||||
"@types/file-saver": "^2.0.7",
|
"@types/file-saver": "^2.0.7",
|
||||||
"@types/node": "^24.6.0",
|
"@types/node": "^24.6.0",
|
||||||
"@types/react": "^19.1.16",
|
"@types/react": "^19.1.16",
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import type React from 'react';
|
// biome-ignore lint/style/useImportType: React is required in scope for the old JSX transform.
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
export type KintonePluginTitleProps = React.PropsWithChildren<{
|
export type KintonePluginTitleProps = React.PropsWithChildren<{
|
||||||
className?: string;
|
className?: string;
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
import { type KintoneFormFieldProperty, KintoneRestAPIClient } from '@kintone/rest-api-client';
|
import { type KintoneFormFieldProperty, KintoneRestAPIClient } from '@kintone/rest-api-client';
|
||||||
import type { KintoneRecord } from '@shin-chan/kypes/types/page';
|
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import Docxtemplater from 'docxtemplater';
|
import Docxtemplater from 'docxtemplater';
|
||||||
import expressionParser from 'docxtemplater/expressions';
|
import expressionParser from 'docxtemplater/expressions';
|
||||||
@@ -134,7 +133,7 @@ const formatCalculatedRecordValue = (
|
|||||||
|
|
||||||
const record2data = (
|
const record2data = (
|
||||||
properties: KintoneFormFieldProperties,
|
properties: KintoneFormFieldProperties,
|
||||||
record: Partial<KintoneRecord>,
|
record: Partial<kintone.types.GenericFields>,
|
||||||
language: string,
|
language: string,
|
||||||
): TemplateData => {
|
): TemplateData => {
|
||||||
const data: TemplateData = {};
|
const data: TemplateData = {};
|
||||||
|
12
src/kintone-env.d.ts
vendored
12
src/kintone-env.d.ts
vendored
@@ -1,12 +0,0 @@
|
|||||||
/// <reference types="@shin-chan/kypes" />
|
|
||||||
|
|
||||||
// CSS modules
|
|
||||||
type CSSModuleClasses = { readonly [key: string]: string };
|
|
||||||
|
|
||||||
declare module '*.module.css' {
|
|
||||||
const classes: CSSModuleClasses;
|
|
||||||
export default classes;
|
|
||||||
}
|
|
||||||
|
|
||||||
// CSS
|
|
||||||
declare module '*.css' {}
|
|
93
src/types/css-modules.d.ts
vendored
Normal file
93
src/types/css-modules.d.ts
vendored
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
// CSS modules
|
||||||
|
type CSSModuleClasses = { readonly [key: string]: string };
|
||||||
|
|
||||||
|
declare module '*.module.css' {
|
||||||
|
const classes: CSSModuleClasses;
|
||||||
|
export default classes;
|
||||||
|
}
|
||||||
|
declare module '*.module.scss' {
|
||||||
|
const classes: CSSModuleClasses;
|
||||||
|
export default classes;
|
||||||
|
}
|
||||||
|
declare module '*.module.sass' {
|
||||||
|
const classes: CSSModuleClasses;
|
||||||
|
export default classes;
|
||||||
|
}
|
||||||
|
declare module '*.module.less' {
|
||||||
|
const classes: CSSModuleClasses;
|
||||||
|
export default classes;
|
||||||
|
}
|
||||||
|
declare module '*.module.styl' {
|
||||||
|
const classes: CSSModuleClasses;
|
||||||
|
export default classes;
|
||||||
|
}
|
||||||
|
declare module '*.module.stylus' {
|
||||||
|
const classes: CSSModuleClasses;
|
||||||
|
export default classes;
|
||||||
|
}
|
||||||
|
declare module '*.module.pcss' {
|
||||||
|
const classes: CSSModuleClasses;
|
||||||
|
export default classes;
|
||||||
|
}
|
||||||
|
declare module '*.module.sss' {
|
||||||
|
const classes: CSSModuleClasses;
|
||||||
|
export default classes;
|
||||||
|
}
|
||||||
|
|
||||||
|
// CSS
|
||||||
|
declare module '*.css' {
|
||||||
|
/**
|
||||||
|
* @deprecated Use `import style from './style.css?inline'` instead.
|
||||||
|
*/
|
||||||
|
const css: string;
|
||||||
|
export default css;
|
||||||
|
}
|
||||||
|
declare module '*.scss' {
|
||||||
|
/**
|
||||||
|
* @deprecated Use `import style from './style.scss?inline'` instead.
|
||||||
|
*/
|
||||||
|
const css: string;
|
||||||
|
export default css;
|
||||||
|
}
|
||||||
|
declare module '*.sass' {
|
||||||
|
/**
|
||||||
|
* @deprecated Use `import style from './style.sass?inline'` instead.
|
||||||
|
*/
|
||||||
|
const css: string;
|
||||||
|
export default css;
|
||||||
|
}
|
||||||
|
declare module '*.less' {
|
||||||
|
/**
|
||||||
|
* @deprecated Use `import style from './style.less?inline'` instead.
|
||||||
|
*/
|
||||||
|
const css: string;
|
||||||
|
export default css;
|
||||||
|
}
|
||||||
|
declare module '*.styl' {
|
||||||
|
/**
|
||||||
|
* @deprecated Use `import style from './style.styl?inline'` instead.
|
||||||
|
*/
|
||||||
|
const css: string;
|
||||||
|
export default css;
|
||||||
|
}
|
||||||
|
declare module '*.stylus' {
|
||||||
|
/**
|
||||||
|
* @deprecated Use `import style from './style.stylus?inline'` instead.
|
||||||
|
*/
|
||||||
|
const css: string;
|
||||||
|
export default css;
|
||||||
|
}
|
||||||
|
declare module '*.pcss' {
|
||||||
|
/**
|
||||||
|
* @deprecated Use `import style from './style.pcss?inline'` instead.
|
||||||
|
*/
|
||||||
|
const css: string;
|
||||||
|
export default css;
|
||||||
|
}
|
||||||
|
declare module '*.sss' {
|
||||||
|
/**
|
||||||
|
* @deprecated Use `import style from './style.sss?inline'` instead.
|
||||||
|
*/
|
||||||
|
const css: string;
|
||||||
|
export default css;
|
||||||
|
}
|
30
src/types/cybozu.d.ts
vendored
Normal file
30
src/types/cybozu.d.ts
vendored
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
declare namespace cybozu.data {
|
||||||
|
namespace types {
|
||||||
|
type SchemaDataField = {
|
||||||
|
id: string;
|
||||||
|
label: string; // field name
|
||||||
|
properties: Record<string, string>;
|
||||||
|
type: string;
|
||||||
|
var: string; // field code
|
||||||
|
};
|
||||||
|
type SchemaDataTable = cybozu.data.types.SchemaDataField & {
|
||||||
|
fieldList: Record<string, cybozu.data.types.SchemaDataField>;
|
||||||
|
};
|
||||||
|
type SchemaDataSubtable = Record<string, cybozu.data.types.SchemaDataTable>;
|
||||||
|
type SchemaDataGroups = Array<{
|
||||||
|
table: cybozu.data.types.SchemaDataTable;
|
||||||
|
subTable: cybozu.data.types.SchemaDataSubtable;
|
||||||
|
}>;
|
||||||
|
type SchemaData = {
|
||||||
|
groups: cybozu.data.types.SchemaDataGroups;
|
||||||
|
revision: string;
|
||||||
|
table: cybozu.data.types.SchemaDataTable;
|
||||||
|
subTable: cybozu.data.types.SchemaDataSubtable;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
namespace page {
|
||||||
|
const FORM_DATA: {
|
||||||
|
schema: cybozu.data.types.SchemaData;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
93
src/types/kintone.d.ts
vendored
Normal file
93
src/types/kintone.d.ts
vendored
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
declare namespace kintone {
|
||||||
|
namespace fieldTypes {
|
||||||
|
interface Category {
|
||||||
|
type?: 'CATEGORY';
|
||||||
|
value: Array<string>;
|
||||||
|
}
|
||||||
|
interface Status {
|
||||||
|
type?: 'STATUS';
|
||||||
|
value: string;
|
||||||
|
}
|
||||||
|
interface StatusAssignee {
|
||||||
|
type?: 'STATUS_ASSIGNEE';
|
||||||
|
value: kintone.fieldTypes.UserSelect['value'];
|
||||||
|
}
|
||||||
|
type InSubtableFieldTypes =
|
||||||
|
| kintone.fieldTypes.SingleLineText
|
||||||
|
| kintone.fieldTypes.RichText
|
||||||
|
| kintone.fieldTypes.MultiLineText
|
||||||
|
| kintone.fieldTypes.Number
|
||||||
|
| kintone.fieldTypes.Calc
|
||||||
|
| kintone.fieldTypes.RadioButton
|
||||||
|
| kintone.fieldTypes.DropDown
|
||||||
|
| kintone.fieldTypes.Date
|
||||||
|
| kintone.fieldTypes.Time
|
||||||
|
| kintone.fieldTypes.DateTime
|
||||||
|
| kintone.fieldTypes.Link
|
||||||
|
| kintone.fieldTypes.CheckBox
|
||||||
|
| kintone.fieldTypes.MultiSelect
|
||||||
|
| kintone.fieldTypes.UserSelect
|
||||||
|
| kintone.fieldTypes.OrganizationSelect
|
||||||
|
| kintone.fieldTypes.GroupSelect
|
||||||
|
| kintone.fieldTypes.File;
|
||||||
|
type SystemFieldTypes =
|
||||||
|
| kintone.fieldTypes.Id
|
||||||
|
| kintone.fieldTypes.Revision
|
||||||
|
| kintone.fieldTypes.Modifier
|
||||||
|
| kintone.fieldTypes.Creator
|
||||||
|
| kintone.fieldTypes.RecordNumber
|
||||||
|
| kintone.fieldTypes.UpdatedTime
|
||||||
|
| kintone.fieldTypes.CreatedTime;
|
||||||
|
type SubtableValue<T extends string> = {
|
||||||
|
id: string;
|
||||||
|
value: Record<T, kintone.fieldTypes.InSubtableFieldTypes>;
|
||||||
|
};
|
||||||
|
type Subtable<T extends string> = {
|
||||||
|
type: 'SUBTABLE';
|
||||||
|
value: Array<SubtableValue<T>>;
|
||||||
|
};
|
||||||
|
type ExtraFieldTypes = Category | Status | StatusAssignee;
|
||||||
|
type GenericFieldTypes = InSubtableFieldTypes | SystemFieldTypes | Subtable<string> | ExtraFieldTypes;
|
||||||
|
}
|
||||||
|
namespace types {
|
||||||
|
type GenericFields = Record<string, kintone.fieldTypes.GenericFieldTypes>;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace events {
|
||||||
|
interface AppRecordIndexEditShowEvent {
|
||||||
|
type: 'app.record.index.edit.show';
|
||||||
|
appId: number;
|
||||||
|
recordId: number;
|
||||||
|
record: kintone.types.SavedFields;
|
||||||
|
}
|
||||||
|
interface AppRecordCreateShowEvent {
|
||||||
|
type: 'app.record.create.show';
|
||||||
|
appId: number;
|
||||||
|
record: kintone.types.Fields;
|
||||||
|
reuse: boolean;
|
||||||
|
}
|
||||||
|
interface AppRecordEditShowEvent {
|
||||||
|
type: 'app.record.edit.show';
|
||||||
|
appId: number;
|
||||||
|
recordId: number;
|
||||||
|
record: kintone.types.SavedFields;
|
||||||
|
}
|
||||||
|
interface AppRecordDetailShowEvent {
|
||||||
|
type: 'app.record.detail.show';
|
||||||
|
appId: number;
|
||||||
|
recordId: number;
|
||||||
|
record: kintone.types.SavedFields;
|
||||||
|
}
|
||||||
|
interface MobileAppRecordDetailShowEvent {
|
||||||
|
type: 'mobile.app.record.detail.show';
|
||||||
|
appId: number;
|
||||||
|
recordId: number;
|
||||||
|
record: kintone.types.SavedFields;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace app {
|
||||||
|
function getFormFields(): Promise<unknown>;
|
||||||
|
function getFormLayout(): Promise<unknown>;
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user