@appsemble/sdk 0.20.9 → 0.20.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +12 -2
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/types.d.ts +0 -142
- package/dist/types.js +0 -7
- package/dist/types.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import type { Action, BaseMessage, BulmaColor, BulmaSize, Theme } from '@appsemble/types';
|
|
1
2
|
import type { IconName } from '@fortawesome/fontawesome-common-types';
|
|
2
3
|
import { Promisable } from 'type-fest';
|
|
3
|
-
import { Action, BulmaColor, Message, Remapper, Theme } from './types';
|
|
4
|
-
export * from './types';
|
|
5
4
|
export { IconName };
|
|
5
|
+
export { Action, BulmaColor, BulmaSize, Theme };
|
|
6
|
+
/**
|
|
7
|
+
* A user defined remapper function.
|
|
8
|
+
*/
|
|
9
|
+
export declare type Remapper = object[] | boolean | number | object | string;
|
|
6
10
|
/**
|
|
7
11
|
* Actions defined on a block.
|
|
8
12
|
*
|
|
@@ -115,6 +119,12 @@ export interface MenuItem {
|
|
|
115
119
|
*/
|
|
116
120
|
active?: boolean;
|
|
117
121
|
}
|
|
122
|
+
export interface Message extends BaseMessage {
|
|
123
|
+
/**
|
|
124
|
+
* The content of the message to display.
|
|
125
|
+
*/
|
|
126
|
+
body: string;
|
|
127
|
+
}
|
|
118
128
|
/**
|
|
119
129
|
* A set of utility functions provided by the Appsemble SDK.
|
|
120
130
|
*/
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiTA;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,EAAqB;IAC7C,MAAM,KAAK,GAA4B,IAAI,WAAW,CAAC,oBAAoB,EAAE;QAC3E,MAAM,EAAE;YACN,EAAE;YACF,QAAQ;SACT;KACF,CAAC,CAAC;IACH,IAAI,QAAQ,CAAC,aAAa,EAAE;QAC1B,QAAQ,CAAC,aAAa,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;KAC7C;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appsemble/sdk",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.10",
|
|
4
4
|
"description": "Build your own blocks",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"test": "jest"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@appsemble/types": "0.20.
|
|
35
|
+
"@appsemble/types": "0.20.10",
|
|
36
36
|
"@fortawesome/fontawesome-common-types": "^6.0.0",
|
|
37
37
|
"type-fest": "^2.0.0"
|
|
38
38
|
}
|
package/dist/types.d.ts
DELETED
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* These types are extracted into this package, so they can be imported in {@link @appsemble/types}
|
|
3
|
-
* without causing type errors. Don’t import from this module directly. Instead, import from
|
|
4
|
-
* {@link @appsemble/sdk}.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* A user defined remapper function.
|
|
8
|
-
*/
|
|
9
|
-
export declare type Remapper = object[] | boolean | number | object | string;
|
|
10
|
-
/**
|
|
11
|
-
* Common HTTP methods, but either all upper case or all lower case.
|
|
12
|
-
*/
|
|
13
|
-
export declare type HTTPMethods = 'DELETE' | 'delete' | 'GET' | 'get' | 'PATCH' | 'patch' | 'POST' | 'post' | 'PUT' | 'put';
|
|
14
|
-
export interface BaseAction<T extends string> {
|
|
15
|
-
/**
|
|
16
|
-
* A function which can be called to dispatch the action.
|
|
17
|
-
*/
|
|
18
|
-
<R>(data?: any, context?: Record<string, any>): Promise<R>;
|
|
19
|
-
/**
|
|
20
|
-
* The type of the action.
|
|
21
|
-
*/
|
|
22
|
-
type: T;
|
|
23
|
-
}
|
|
24
|
-
export interface LinkAction extends BaseAction<'link'> {
|
|
25
|
-
/**
|
|
26
|
-
* Get the link that the action would link to if the given data was passed.
|
|
27
|
-
*/
|
|
28
|
-
href: (data?: unknown) => string;
|
|
29
|
-
}
|
|
30
|
-
export interface LogAction extends BaseAction<'log'> {
|
|
31
|
-
/**
|
|
32
|
-
* The logging level.
|
|
33
|
-
*/
|
|
34
|
-
level: 'error' | 'info' | 'warn';
|
|
35
|
-
}
|
|
36
|
-
interface RequestLikeAction<T extends Action['type']> extends BaseAction<T> {
|
|
37
|
-
/**
|
|
38
|
-
* The HTTP method used to make the request.
|
|
39
|
-
*/
|
|
40
|
-
method: HTTPMethods;
|
|
41
|
-
/**
|
|
42
|
-
* The URL to which the request will be made.
|
|
43
|
-
*/
|
|
44
|
-
url: Remapper;
|
|
45
|
-
}
|
|
46
|
-
export declare type RequestAction = RequestLikeAction<'request'>;
|
|
47
|
-
export declare type ResourceCreateAction = RequestLikeAction<'resource.create'>;
|
|
48
|
-
export declare type ResourceDeleteAction = RequestLikeAction<'resource.delete'>;
|
|
49
|
-
export declare type ResourceGetAction = RequestLikeAction<'resource.get'>;
|
|
50
|
-
export declare type ResourceQueryAction = RequestLikeAction<'resource.query'>;
|
|
51
|
-
export declare type ResourceCountAction = RequestLikeAction<'resource.count'>;
|
|
52
|
-
export declare type ResourceUpdateAction = RequestLikeAction<'resource.update'>;
|
|
53
|
-
/**
|
|
54
|
-
* An action that can be called from within a block.
|
|
55
|
-
*/
|
|
56
|
-
export declare type Action = BaseAction<'analytics'> | BaseAction<'condition'> | BaseAction<'dialog.error'> | BaseAction<'dialog.ok'> | BaseAction<'dialog'> | BaseAction<'download'> | BaseAction<'email'> | BaseAction<'event'> | BaseAction<'flow.back'> | BaseAction<'flow.cancel'> | BaseAction<'flow.finish'> | BaseAction<'flow.next'> | BaseAction<'flow.to'> | BaseAction<'link.back'> | BaseAction<'link.next'> | BaseAction<'message'> | BaseAction<'noop'> | BaseAction<'resource.subscription.status'> | BaseAction<'resource.subscription.subscribe'> | BaseAction<'resource.subscription.toggle'> | BaseAction<'resource.subscription.unsubscribe'> | BaseAction<'share'> | BaseAction<'static'> | BaseAction<'storage.read'> | BaseAction<'storage.write'> | BaseAction<'team.invite'> | BaseAction<'team.join'> | BaseAction<'team.list'> | BaseAction<'throw'> | BaseAction<'user.login'> | BaseAction<'user.register'> | BaseAction<'user.update'> | LinkAction | LogAction | RequestAction | ResourceCountAction | ResourceCreateAction | ResourceDeleteAction | ResourceGetAction | ResourceQueryAction | ResourceUpdateAction;
|
|
57
|
-
/**
|
|
58
|
-
* A color known to Bulma.
|
|
59
|
-
*/
|
|
60
|
-
export declare type BulmaColor = 'danger' | 'dark' | 'info' | 'link' | 'primary' | 'success' | 'warning' | 'white';
|
|
61
|
-
export declare type BulmaSize = 'large' | 'medium' | 'normal' | 'small';
|
|
62
|
-
export interface BaseMessage {
|
|
63
|
-
/**
|
|
64
|
-
* The color to use for the message.
|
|
65
|
-
*
|
|
66
|
-
* @default 'info'
|
|
67
|
-
*/
|
|
68
|
-
color?: BulmaColor;
|
|
69
|
-
/**
|
|
70
|
-
* The timeout period for this message (in milliseconds).
|
|
71
|
-
*
|
|
72
|
-
* @default 5000
|
|
73
|
-
*/
|
|
74
|
-
timeout?: number;
|
|
75
|
-
/**
|
|
76
|
-
* Whether or not to show the dismiss button.
|
|
77
|
-
*
|
|
78
|
-
* @default false
|
|
79
|
-
*/
|
|
80
|
-
dismissable?: boolean;
|
|
81
|
-
}
|
|
82
|
-
export interface Message extends BaseMessage {
|
|
83
|
-
/**
|
|
84
|
-
* The content of the message to display.
|
|
85
|
-
*/
|
|
86
|
-
body: string;
|
|
87
|
-
}
|
|
88
|
-
export interface FontDefinition {
|
|
89
|
-
/**
|
|
90
|
-
* Where to load a font from.
|
|
91
|
-
*/
|
|
92
|
-
source?: 'custom' | 'google';
|
|
93
|
-
/**
|
|
94
|
-
* The name of the font family.
|
|
95
|
-
*
|
|
96
|
-
* This will be referenced in the Bulma CSS.
|
|
97
|
-
*/
|
|
98
|
-
family: string;
|
|
99
|
-
}
|
|
100
|
-
export interface Theme {
|
|
101
|
-
/**
|
|
102
|
-
* The color primarily featured in the color scheme.
|
|
103
|
-
*/
|
|
104
|
-
primaryColor: string;
|
|
105
|
-
/**
|
|
106
|
-
* The color used for links.
|
|
107
|
-
*/
|
|
108
|
-
linkColor: string;
|
|
109
|
-
/**
|
|
110
|
-
* The color used to feature succesful or positive actions.
|
|
111
|
-
*/
|
|
112
|
-
successColor: string;
|
|
113
|
-
/**
|
|
114
|
-
* The color used to indicate information.
|
|
115
|
-
*/
|
|
116
|
-
infoColor: string;
|
|
117
|
-
/**
|
|
118
|
-
* The color used for elements that require extra attention.
|
|
119
|
-
*/
|
|
120
|
-
warningColor: string;
|
|
121
|
-
/**
|
|
122
|
-
* The color used for elements that demand caution for destructive actions.
|
|
123
|
-
*/
|
|
124
|
-
dangerColor: string;
|
|
125
|
-
/**
|
|
126
|
-
* The color used in the foreground of the splash screen.
|
|
127
|
-
*/
|
|
128
|
-
themeColor: string;
|
|
129
|
-
/**
|
|
130
|
-
* The color used in the background of the splash screen.
|
|
131
|
-
*/
|
|
132
|
-
splashColor: string;
|
|
133
|
-
/**
|
|
134
|
-
* The link to the tile layer used for Leaflet maps.
|
|
135
|
-
*/
|
|
136
|
-
tileLayer: string;
|
|
137
|
-
/**
|
|
138
|
-
* The name of a font available on Google fonts.
|
|
139
|
-
*/
|
|
140
|
-
font: FontDefinition;
|
|
141
|
-
}
|
|
142
|
-
export {};
|
package/dist/types.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* These types are extracted into this package, so they can be imported in {@link @appsemble/types}
|
|
3
|
-
* without causing type errors. Don’t import from this module directly. Instead, import from
|
|
4
|
-
* {@link @appsemble/sdk}.
|
|
5
|
-
*/
|
|
6
|
-
export {};
|
|
7
|
-
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|