New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

@toddledev/core

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@toddledev/core - npm Package Compare versions

Comparing version

to
0.0.6

@@ -46,2 +46,3 @@ import type { EventModel } from '../component/component.types';

export type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | 307 | 308;
export type ApiParserMode = 'auto' | 'text' | 'json' | 'event-stream' | 'json-stream' | 'blob';
export interface ApiBase extends ToddleMetadata {

@@ -93,3 +94,3 @@ url?: Formula;

onMessage?: EventModel | null;
parserMode: 'auto' | 'text' | 'json' | 'event-stream' | 'json-stream' | 'blob';
parserMode: ApiParserMode;
};

@@ -96,0 +97,0 @@ redirectRules?: Record<string, {

import { isFormula } from '../formula/formula';
import { getFormulasInAction, getFormulasInFormula, } from '../formula/formulaUtils';
import { isDefined } from '../utils/util';
import {} from './apiTypes';
export class LegacyToddleApi {

@@ -5,0 +6,0 @@ api;

@@ -57,3 +57,3 @@ import type { ActionModel } from '../component/component.types';

onMessage?: import("../component/component.types").EventModel | null;
parserMode: "auto" | "text" | "json" | "event-stream" | "json-stream" | "blob";
parserMode: import("./apiTypes").ApiParserMode;
} | undefined;

@@ -60,0 +60,0 @@ get redirectRules(): Record<string, {

import { getActionsInAction } from '../component/actionUtils';
import {} from '../formula/formula';
import { getFormulasInAction, getFormulasInFormula, } from '../formula/formulaUtils';

@@ -3,0 +4,0 @@ import { isDefined } from '../utils/util';

@@ -186,5 +186,3 @@ import { omitKeys } from '../utils/collections';

insertComponentStyles(childComponent, node.package ?? package_name);
stylesheet +=
'\n' +
getNodeStyles(node, toValidClassName(`${component.name}:${id}`, true));
stylesheet += getNodeStyles(node, toValidClassName(`${component.name}:${id}`, true));
return;

@@ -201,3 +199,3 @@ }

hashes.add(classHash);
stylesheet += '\n' + getNodeStyles(node, classHash);
stylesheet += getNodeStyles(node, classHash);
});

@@ -204,0 +202,0 @@ }

@@ -6,5 +6,3 @@ import { RESET_STYLES } from './theme.const';

}
return `
${options.includeResetStyle ? RESET_STYLES : ''}
return `${options.includeResetStyle ? RESET_STYLES : ''}
@layer base {

@@ -28,3 +26,2 @@ ${options.createFontFaces

: ''}
body, :host {

@@ -46,3 +43,2 @@ /* Color */

.join('\n')}
/* Font weight */

@@ -56,3 +52,2 @@ ${theme['font-weight']

.join('\n')}
/* Shadows */

@@ -66,3 +61,2 @@ ${theme.shadow

.join('\n')}
/* Border radius */

@@ -74,3 +68,2 @@ ${theme['border-radius']

.join('\n')}
/* Spacing */

@@ -86,3 +79,2 @@ ${theme.spacing

.join('\n')}
/* Z-index */

@@ -99,3 +91,2 @@ ${theme['z-index']

}
@keyframes animation-spin {

@@ -109,3 +100,2 @@ from {

}
@keyframes animation-fade-in {

@@ -119,4 +109,2 @@ from {

}
@keyframes animation-fade-out {

@@ -123,0 +111,0 @@ from {

@@ -12,5 +12,9 @@ const LOCALHOSTS = ['http://localhost:54404', 'http://preview.localhost:54404'];

// So we need to iterate over them to make sure they are encoded as that happens when setting them explicitly
urlObject.searchParams.forEach((value, key) => {
urlObject.searchParams.set(key, value);
const searchCopy = new URLSearchParams(urlObject.searchParams);
searchCopy.forEach((value, key) => {
urlObject.searchParams.delete(key, value);
});
searchCopy.forEach((value, key) => {
urlObject.searchParams.append(key, value);
});
return urlObject;

@@ -17,0 +21,0 @@ }

@@ -17,3 +17,3 @@ {

"main": "dist/index.js",
"version": "0.0.5"
"version": "0.0.6"
}

@@ -47,2 +47,10 @@ import type { EventModel } from '../component/component.types'

export type ApiParserMode =
| 'auto'
| 'text'
| 'json'
| 'event-stream'
| 'json-stream'
| 'blob'
export interface ApiBase extends ToddleMetadata {

@@ -90,9 +98,3 @@ url?: Formula

// stream: The response will be handled as a stream
parserMode:
| 'auto'
| 'text'
| 'json'
| 'event-stream'
| 'json-stream'
| 'blob'
parserMode: ApiParserMode
}

@@ -99,0 +101,0 @@ // Shared logic for client/server 👇

@@ -242,8 +242,6 @@ // cSpell:ignore thinn, ABCDEFGHIJKLMNOPQRSTYVWXYZ

insertComponentStyles(childComponent, node.package ?? package_name)
stylesheet +=
'\n' +
getNodeStyles(
node as any,
toValidClassName(`${component.name}:${id}`, true),
)
stylesheet += getNodeStyles(
node as any,
toValidClassName(`${component.name}:${id}`, true),
)

@@ -261,3 +259,3 @@ return

hashes.add(classHash)
stylesheet += '\n' + getNodeStyles(node as any, classHash)
stylesheet += getNodeStyles(node as any, classHash)
})

@@ -264,0 +262,0 @@ }

@@ -88,5 +88,3 @@ import { RESET_STYLES } from './theme.const'

}
return `
${options.includeResetStyle ? RESET_STYLES : ''}
return `${options.includeResetStyle ? RESET_STYLES : ''}
@layer base {

@@ -121,3 +119,2 @@ ${

}
body, :host {

@@ -148,3 +145,2 @@ /* Color */

.join('\n')}
/* Font weight */

@@ -163,3 +159,2 @@ ${theme['font-weight']

.join('\n')}
/* Shadows */

@@ -178,3 +173,2 @@ ${theme.shadow

.join('\n')}
/* Border radius */

@@ -191,3 +185,2 @@ ${theme['border-radius']

.join('\n')}
/* Spacing */

@@ -208,3 +201,2 @@ ${theme.spacing

.join('\n')}
/* Z-index */

@@ -226,3 +218,2 @@ ${theme['z-index']

}
@keyframes animation-spin {

@@ -236,3 +227,2 @@ from {

}
@keyframes animation-fade-in {

@@ -246,4 +236,2 @@ from {

}
@keyframes animation-fade-out {

@@ -250,0 +238,0 @@ from {

@@ -9,2 +9,10 @@ import { describe, expect, test } from '@jest/globals'

})
test('it validates urls arrays in query params correctly', async () => {
const url = validateUrl('https://toddle.dev?test=1&test=2')
expect(url).toBeInstanceOf(URL)
if (url instanceof URL) {
expect(url.searchParams.getAll('test')).toEqual(['1', '2'])
}
})
})

@@ -18,5 +18,9 @@ const LOCALHOSTS = ['http://localhost:54404', 'http://preview.localhost:54404']

// So we need to iterate over them to make sure they are encoded as that happens when setting them explicitly
urlObject.searchParams.forEach((value, key) => {
urlObject.searchParams.set(key, value)
const searchCopy = new URLSearchParams(urlObject.searchParams)
searchCopy.forEach((value, key) => {
urlObject.searchParams.delete(key, value)
})
searchCopy.forEach((value, key) => {
urlObject.searchParams.append(key, value)
})
return urlObject

@@ -23,0 +27,0 @@ } catch {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet