Skip to content

Commit b04f973

Browse files
author
Arnaud RITTI
committed
ci: deploy
1 parent f130ae4 commit b04f973

47 files changed

Lines changed: 6564 additions & 2761 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,5 @@ yarn-error.log
3737

3838
.eslintcache
3939
inventory.yaml
40+
41+
/var
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import BackendRequest from './BackendRequest';
2+
export interface ChildrenFingerprints {
3+
[key: string]: {
4+
fingerprint: string;
5+
tag: string;
6+
};
7+
}
8+
export interface BackendInterface {
9+
makeRequest(props: any, actions: BackendAction[], updated: {
10+
[key: string]: any;
11+
}, children: ChildrenFingerprints, updatedPropsFromParent: {
12+
[key: string]: any;
13+
}, files: {
14+
[key: string]: FileList;
15+
}): BackendRequest;
16+
}
17+
export interface BackendAction {
18+
name: string;
19+
args: Record<string, string>;
20+
}
21+
export default class implements BackendInterface {
22+
private readonly requestBuilder;
23+
constructor(url: string, method?: 'get' | 'post', csrfToken?: string | null);
24+
makeRequest(props: any, actions: BackendAction[], updated: {
25+
[key: string]: any;
26+
}, children: ChildrenFingerprints, updatedPropsFromParent: {
27+
[key: string]: any;
28+
}, files: {
29+
[key: string]: FileList;
30+
}): BackendRequest;
31+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default class {
2+
promise: Promise<Response>;
3+
actions: string[];
4+
updatedModels: string[];
5+
isResolved: boolean;
6+
constructor(promise: Promise<Response>, actions: string[], updateModels: string[]);
7+
containsOneOfActions(targetedActions: string[]): boolean;
8+
areAnyModelsUpdated(targetedModels: string[]): boolean;
9+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default class {
2+
response: Response;
3+
private body;
4+
constructor(response: Response);
5+
getBody(): Promise<string>;
6+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { BackendAction, ChildrenFingerprints } from './Backend';
2+
export default class {
3+
private url;
4+
private method;
5+
private readonly csrfToken;
6+
constructor(url: string, method?: 'get' | 'post', csrfToken?: string | null);
7+
buildRequest(props: any, actions: BackendAction[], updated: {
8+
[key: string]: any;
9+
}, children: ChildrenFingerprints, updatedPropsFromParent: {
10+
[key: string]: any;
11+
}, files: {
12+
[key: string]: FileList;
13+
}): {
14+
url: string;
15+
fetchOptions: RequestInit;
16+
};
17+
private willDataFitInUrl;
18+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import LiveControllerDefault from '../live_controller';
2+
export interface ElementDriver {
3+
getModelName(element: HTMLElement): string | null;
4+
getComponentProps(): any;
5+
getEventsToEmit(): Array<{
6+
event: string;
7+
data: any;
8+
target: string | null;
9+
componentName: string | null;
10+
}>;
11+
getBrowserEventsToDispatch(): Array<{
12+
event: string;
13+
payload: any;
14+
}>;
15+
}
16+
export declare class StimulusElementDriver implements ElementDriver {
17+
private readonly controller;
18+
constructor(controller: LiveControllerDefault);
19+
getModelName(element: HTMLElement): string | null;
20+
getComponentProps(): any;
21+
getEventsToEmit(): Array<{
22+
event: string;
23+
data: any;
24+
target: string | null;
25+
componentName: string | null;
26+
}>;
27+
getBrowserEventsToDispatch(): Array<{
28+
event: string;
29+
payload: any;
30+
}>;
31+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { ElementDriver } from './ElementDriver';
2+
import Component from './index';
3+
export default class {
4+
private readonly component;
5+
private readonly modelElementResolver;
6+
private readonly unsyncedInputs;
7+
private elementEventListeners;
8+
constructor(component: Component, modelElementResolver: ElementDriver);
9+
activate(): void;
10+
deactivate(): void;
11+
markModelAsSynced(modelName: string): void;
12+
private handleInputEvent;
13+
private updateModelFromElement;
14+
getUnsyncedInputs(): HTMLElement[];
15+
getUnsyncedModels(): string[];
16+
resetUnsyncedFields(): void;
17+
}
18+
export declare class UnsyncedInputContainer {
19+
private unsyncedModelFields;
20+
private unsyncedNonModelFields;
21+
private unsyncedModelNames;
22+
constructor();
23+
add(element: HTMLElement, modelName?: string | null): void;
24+
resetUnsyncedFields(): void;
25+
allUnsyncedInputs(): HTMLElement[];
26+
markModelAsSynced(modelName: string): void;
27+
getUnsyncedModelNames(): string[];
28+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
export default class {
2+
private props;
3+
private dirtyProps;
4+
private pendingProps;
5+
private updatedPropsFromParent;
6+
constructor(props: any);
7+
get(name: string): any;
8+
has(name: string): boolean;
9+
set(name: string, value: any): boolean;
10+
getOriginalProps(): any;
11+
getDirtyProps(): any;
12+
getUpdatedPropsFromParent(): any;
13+
flushDirtyPropsToPending(): void;
14+
reinitializeAllProps(props: any): void;
15+
pushPendingPropsBackToDirty(): void;
16+
storeNewPropsFromParent(props: any): boolean;
17+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import { BackendInterface } from '../Backend/Backend';
2+
import ValueStore from './ValueStore';
3+
import { ElementDriver } from './ElementDriver';
4+
import { PluginInterface } from './plugins/PluginInterface';
5+
import BackendResponse from '../Backend/BackendResponse';
6+
export default class Component {
7+
readonly element: HTMLElement;
8+
readonly name: string;
9+
readonly listeners: Map<string, string[]>;
10+
private backend;
11+
readonly elementDriver: ElementDriver;
12+
id: string | null;
13+
fingerprint: string;
14+
readonly valueStore: ValueStore;
15+
private readonly unsyncedInputsTracker;
16+
private hooks;
17+
defaultDebounce: number;
18+
private backendRequest;
19+
private pendingActions;
20+
private pendingFiles;
21+
private isRequestPending;
22+
private requestDebounceTimeout;
23+
private nextRequestPromise;
24+
private nextRequestPromiseResolve;
25+
private externalMutationTracker;
26+
constructor(element: HTMLElement, name: string, props: any, listeners: Array<{
27+
event: string;
28+
action: string;
29+
}>, id: string | null, backend: BackendInterface, elementDriver: ElementDriver);
30+
addPlugin(plugin: PluginInterface): void;
31+
connect(): void;
32+
disconnect(): void;
33+
on(hookName: string, callback: (...args: any[]) => void): void;
34+
off(hookName: string, callback: (...args: any[]) => void): void;
35+
set(model: string, value: any, reRender?: boolean, debounce?: number | boolean): Promise<BackendResponse>;
36+
getData(model: string): any;
37+
action(name: string, args?: any, debounce?: number | boolean): Promise<BackendResponse>;
38+
files(key: string, input: HTMLInputElement): void;
39+
render(): Promise<BackendResponse>;
40+
getUnsyncedModels(): string[];
41+
emit(name: string, data: any, onlyMatchingComponentsNamed?: string | null): void;
42+
emitUp(name: string, data: any, onlyMatchingComponentsNamed?: string | null): void;
43+
emitSelf(name: string, data: any): void;
44+
private performEmit;
45+
private doEmit;
46+
private isTurboEnabled;
47+
private tryStartingRequest;
48+
private performRequest;
49+
private processRerender;
50+
private calculateDebounce;
51+
private clearRequestDebounceTimeout;
52+
private debouncedStartRequest;
53+
private renderError;
54+
private resetPromise;
55+
_updateFromParentProps(props: any): void;
56+
}
57+
export declare function proxifyComponent(component: Component): Component;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Component from '../../Component';
2+
import { PluginInterface } from './PluginInterface';
3+
export default class implements PluginInterface {
4+
private readonly component;
5+
private parentModelBindings;
6+
constructor(component: Component);
7+
attachToComponent(component: Component): void;
8+
private getChildrenFingerprints;
9+
private notifyParentModelChange;
10+
private getChildren;
11+
}

0 commit comments

Comments
 (0)