> = ({
4 | href,
5 | children,
6 | ...props
7 | }) => {
8 | return (
9 |
10 | {children}
11 |
12 | )
13 | }
14 |
--------------------------------------------------------------------------------
/packages/core/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ### UPCOMING
2 |
3 | - improved logging during JSON.parse errors
4 | - deprecation notice on `Builder.VERSION`
5 | - stop tracking impressions for content with no id
6 |
7 | ### 1.1.26
8 |
9 | - fix: respect `builder.canTrack` for not setting the session cookie https://github.com/BuilderIO/builder/pull/900
10 |
--------------------------------------------------------------------------------
/plugins/async-dropdown/__tests__/mapperEvaluator.test.ts:
--------------------------------------------------------------------------------
1 | import { safeEvaluate } from '../src/helpers/mapperEvaluator';
2 |
3 | describe('Safe evaluate', () => {
4 | it('Works', () => {
5 | expect(safeEvaluate('() => true')).toBe(true);
6 | expect(safeEvaluate('({foo}) => foo.bar', { foo: { bar: 'hi' } })).toBe('hi');
7 | });
8 | });
9 |
--------------------------------------------------------------------------------
/examples/next-js-simple/pages/_app.tsx:
--------------------------------------------------------------------------------
1 | import type { AppProps } from 'next/app'
2 |
3 | import { builder } from '@builder.io/react'
4 | import builderConfig from '@config/builder'
5 | builder.init(builderConfig.apiKey)
6 |
7 | export default function MyApp({ Component, pageProps }: AppProps) {
8 | return
9 | }
10 |
--------------------------------------------------------------------------------
/examples/react-native/scripts/add-resolutions.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # You'll need to install `jq`: https://stedolan.github.io/jq/
3 |
4 | # Sets `@builder.io/sdk-react-native` resolution symlinks in `package.json`
5 | echo "$(jq '.resolutions."@builder.io/sdk-react-native" = "link:../../packages/sdks/output/react-native"' package.json)" >package.json
6 |
--------------------------------------------------------------------------------
/examples/vue/vue-storefront-2/tests/e2e/pages/base.ts:
--------------------------------------------------------------------------------
1 | import Header from './components/header';
2 |
3 | export default class Base {
4 | get path(): string {
5 | return '/';
6 | }
7 |
8 | get header() {
9 | return Header;
10 | }
11 |
12 | visit(): Cypress.Chainable {
13 | return cy.visit(this.path);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/packages/json-schema/Makefile:
--------------------------------------------------------------------------------
1 | export NODE_OPTIONS="--unhandled-rejections=strict"
2 |
3 | all: dist/BuilderContent.json
4 |
5 | @PHONY:
6 | clean:
7 | rm dist/BuilderContent.json
8 |
9 | dist/%.json: tsconfig.json src/index.ts
10 | mkdir -p dist
11 | yarn --silent run typescript-json-schema tsconfig.json $(basename $(notdir $@)) > $@
12 |
--------------------------------------------------------------------------------
/examples/vue/vue-storefront-2/helpers/validators/phone.ts:
--------------------------------------------------------------------------------
1 | import { extend } from 'vee-validate';
2 | import PhoneNumber from 'awesome-phonenumber';
3 |
4 | extend('phone', {
5 | message: 'This is not a valid phone number',
6 | validate(value) {
7 | const phone = new PhoneNumber(value);
8 | return phone.isValid();
9 | },
10 | });
11 |
--------------------------------------------------------------------------------
/packages/android/sdk/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/packages/sdks/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "strict": true,
4 | "target": "es5",
5 | "jsx": "preserve",
6 | "jsxImportSource": "@builder.io/mitosis",
7 | "esModuleInterop": true,
8 | "skipLibCheck": true,
9 | "forceConsistentCasingInFileNames": true
10 | },
11 | "include": ["src", "typings"]
12 | }
13 |
--------------------------------------------------------------------------------
/packages/utils/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "rootDir": "src",
4 | "outDir": "dist",
5 | "module": "CommonJS",
6 | "target": "es6",
7 | "esModuleInterop": true,
8 | "strict": true,
9 | "declaration": true
10 | },
11 | "include": ["./src"],
12 | "exclude": ["node_modules", "**/*.test.ts"]
13 | }
14 |
--------------------------------------------------------------------------------
/examples/storybook/src/components/Button/Button.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import MuiButon from '@material-ui/core/Button';
3 |
4 | export const Button = props => {
5 | const { text, link, type } = props;
6 |
7 | return (
8 |
9 | {text}
10 |
11 | );
12 | };
13 |
--------------------------------------------------------------------------------
/examples/svelte-design-system/src/components/index.ts:
--------------------------------------------------------------------------------
1 | import BoxWithChildren from './BoxWithChildren/BoxWithChildren.builder';
2 | import Button from './Button/Button.builder';
3 | import CustomColumns from './CustomColumns/CustomColumns.builder';
4 | import Hero from './Hero/Hero.builder';
5 |
6 | export default [BoxWithChildren, Button, CustomColumns, Hero];
7 |
--------------------------------------------------------------------------------
/examples/vue/vue-storefront-2/tests/e2e/pages/components/breadcrumbs.ts:
--------------------------------------------------------------------------------
1 | class Breadcrumbs {
2 | get container(): Cypress.Chainable {
3 | return cy.get('.breadcrumbs');
4 | }
5 |
6 | get listItems(): Cypress.Chainable {
7 | return this.container.get('.sf-breadcrumbs__list-item');
8 | }
9 | }
10 |
11 | export default new Breadcrumbs();
12 |
--------------------------------------------------------------------------------
/packages/android/sdk/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/examples/embed-starter-kit/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "multi-site-poc",
3 | "version": "1.0.0",
4 | "scripts": {
5 | "build": "cd ./site && next build",
6 | "prettier": "prettier"
7 | },
8 | "prettier": {
9 | "semi": false,
10 | "singleQuote": true
11 | },
12 | "devDependencies": {
13 | "prettier": "^2.1.2"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/examples/embed-starter-kit/site/helpers/get-layout-props.ts:
--------------------------------------------------------------------------------
1 | import { builder } from '@builder.io/react'
2 |
3 | /**
4 | * Get global layout props
5 | */
6 | export async function getLayoutProps() {
7 | return {
8 | theme: (await builder.get('theme').promise()) || null,
9 | header: (await builder.get('header').promise()) || null,
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/packages/codegen/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es5",
4 | "module": "commonjs",
5 | "strict": true,
6 | "jsx": "preserve",
7 | "lib": ["es7", "dom"],
8 | "skipLibCheck": true,
9 | "resolveJsonModule": true,
10 | "noFallthroughCasesInSwitch": true
11 | },
12 | "exclude": ["node_modules"]
13 | }
14 |
--------------------------------------------------------------------------------
/packages/vue/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 |
6 | # local env files
7 | .env.local
8 | .env.*.local
9 |
10 | # Log files
11 | npm-debug.log*
12 | yarn-debug.log*
13 | yarn-error.log*
14 | pnpm-debug.log*
15 |
16 | # Editor directories and files
17 | .idea
18 | .vscode
19 | *.suo
20 | *.ntvs*
21 | *.njsproj
22 | *.sln
23 | *.sw?
24 |
--------------------------------------------------------------------------------
/starters/create-builder/nextjs/components/Header.tsx:
--------------------------------------------------------------------------------
1 | export interface HeaderProps {
2 | title: string;
3 | subtitle: string;
4 | }
5 |
6 | export function Header(props: HeaderProps) {
7 | return (
8 |
9 |
10 |
11 |
12 | );
13 | }
14 |
--------------------------------------------------------------------------------
/examples/embed-starter-kit/site/blocks/header/nav-links/nav-links.tsx:
--------------------------------------------------------------------------------
1 | import { Button } from '@mui/material'
2 |
3 | export default function NavLinks() {
4 | return (
5 |
6 |
7 |
8 |
9 | )
10 | }
11 |
--------------------------------------------------------------------------------
/examples/react-design-system/src/components/Button/Button.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import MuiButon from '@material-ui/core/Button';
3 |
4 | export const Button = props => {
5 | const { text, link, type } = props;
6 |
7 | return (
8 |
9 | {text}
10 |
11 | );
12 | };
13 |
--------------------------------------------------------------------------------
/examples/vue/vue-2/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 |
6 | # local env files
7 | .env.local
8 | .env.*.local
9 |
10 | # Log files
11 | npm-debug.log*
12 | yarn-debug.log*
13 | yarn-error.log*
14 | pnpm-debug.log*
15 |
16 | # Editor directories and files
17 | .idea
18 | .vscode
19 | *.suo
20 | *.ntvs*
21 | *.njsproj
22 | *.sln
23 | *.sw?
24 |
--------------------------------------------------------------------------------
/examples/vue/vue-3/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | /* eslint-env node */
2 | require('@rushstack/eslint-patch/modern-module-resolution');
3 |
4 | module.exports = {
5 | root: true,
6 | extends: [
7 | 'plugin:vue/vue3-essential',
8 | 'eslint:recommended',
9 | '@vue/eslint-config-typescript/recommended',
10 | '@vue/eslint-config-prettier',
11 | ],
12 | };
13 |
--------------------------------------------------------------------------------
/packages/cli/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "rootDir": "src",
4 | "outDir": "dist",
5 | "module": "CommonJS",
6 | "target": "es6",
7 | "esModuleInterop": true,
8 | "strict": true,
9 | "allowJs": true,
10 | "resolveJsonModule": true,
11 | "types": ["node"],
12 | },
13 | "exclude": ["src/templates"],
14 | }
15 |
--------------------------------------------------------------------------------
/examples/gatsby-minimal-starter/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | interface CSSModule {
2 | [className: string]: string;
3 | }
4 |
5 | // type shims for CSS modules
6 | declare module '*.module.scss' {
7 | const cssModule: CSSModule;
8 | export = cssModule;
9 | }
10 |
11 | declare module '*.module.css' {
12 | const cssModule: CSSModule;
13 | export = cssModule;
14 | }
15 |
--------------------------------------------------------------------------------
/examples/svelte-design-system/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./.svelte-kit/tsconfig.json",
3 | "compilerOptions": {
4 | "allowJs": true,
5 | "checkJs": true,
6 | "esModuleInterop": true,
7 | "forceConsistentCasingInFileNames": true,
8 | "resolveJsonModule": true,
9 | "skipLibCheck": true,
10 | "sourceMap": true,
11 | "strict": true
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/packages/create-builder.io/src/texts.ts:
--------------------------------------------------------------------------------
1 | import { IS_YARN } from './utils';
2 |
3 | export const CMD = IS_YARN ? 'yarn' : 'npm';
4 | export const INSTALL = IS_YARN ? 'yarn' : 'npm install';
5 | export const BUILD = IS_YARN ? 'yarn build' : 'npm run build';
6 | export const START = IS_YARN ? 'yarn start' : 'npm start';
7 | export const TEST = IS_YARN ? 'yarn test' : 'npm test';
8 |
--------------------------------------------------------------------------------
/starters/create-builder/create-react-app/src/components/Header.tsx:
--------------------------------------------------------------------------------
1 | export interface HeaderProps {
2 | title: string;
3 | subtitle: string;
4 | }
5 |
6 | export function Header(props: HeaderProps) {
7 | return (
8 |
9 |
10 |
11 |
12 | );
13 | }
14 |
--------------------------------------------------------------------------------
/starters/create-builder/nextjs/components/SourceCodeLink.tsx:
--------------------------------------------------------------------------------
1 | import { FunctionComponent } from 'react';
2 |
3 | export interface SourceCodeLinkProps {
4 | fileName: string;
5 | line?: number;
6 | column?: number;
7 | }
8 |
9 | export const SourceCodeLink: FunctionComponent = ({ children }) => {
10 | return {children}
;
11 | };
12 |
--------------------------------------------------------------------------------
/examples/next-js-builder-site/src/components/docs-search.config.ts:
--------------------------------------------------------------------------------
1 | export const defaultSearchBarPlaceholder = 'Search the knowledge base';
2 |
3 | export const docsSearchConfig = {
4 | name: 'Docs Search',
5 | inputs: [
6 | {
7 | name: 'placeholder',
8 | type: 'text',
9 | defaultValue: defaultSearchBarPlaceholder,
10 | },
11 | ],
12 | };
13 |
--------------------------------------------------------------------------------
/examples/vue/vue-3/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@vue/tsconfig/tsconfig.web.json",
3 | "include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
4 | "compilerOptions": {
5 | "baseUrl": ".",
6 | "paths": {
7 | "@/*": ["./src/*"]
8 | }
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "./tsconfig.config.json"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/packages/fiddle/README.md:
--------------------------------------------------------------------------------
1 | # @builder.io/fiddle
2 |
3 | Embed Builder.io [fiddles](https://builder.io/fiddle) on your site
4 |
5 | ```html
6 |
7 |
8 | ```
9 |
10 | 
11 |
--------------------------------------------------------------------------------
/packages/react/src/functions/get.ts:
--------------------------------------------------------------------------------
1 | export const get = (obj: any, path: string, defaultValue?: any) => {
2 | const result = String.prototype.split
3 | .call(path, /[,[\].]+?/)
4 | .filter(Boolean)
5 | .reduce((res, key) => (res !== null && res !== undefined ? res[key] : res), obj);
6 | return result === undefined || result === obj ? defaultValue : result;
7 | };
8 |
--------------------------------------------------------------------------------
/examples/vue/nuxt-2-old-sdk/components/hello-world.vue:
--------------------------------------------------------------------------------
1 |
2 | Hello {{ text }}!
3 |
4 |
5 |
15 |
16 |
21 |
--------------------------------------------------------------------------------
/packages/sdks/src/blocks/submit-button/submit-button.lite.tsx:
--------------------------------------------------------------------------------
1 | import '@builder.io/mitosis';
2 |
3 | export interface ButtonProps {
4 | attributes?: any;
5 | text?: string;
6 | }
7 |
8 | export default function SubmitButton(props: ButtonProps) {
9 | return (
10 |
13 | );
14 | }
15 |
--------------------------------------------------------------------------------
/examples/embed-starter-kit/site/blocks/header/spacer/spacer.tsx:
--------------------------------------------------------------------------------
1 | export default function Spacer(props: any) {
2 | return (
3 |
13 | )
14 | }
15 |
--------------------------------------------------------------------------------
/packages/angular/e2e/app.e2e-spec.ts:
--------------------------------------------------------------------------------
1 | import { AppPage } from './app.po';
2 |
3 | describe('angular App', () => {
4 | let page: AppPage;
5 |
6 | beforeEach(() => {
7 | page = new AppPage();
8 | });
9 |
10 | it('should display welcome message', () => {
11 | page.navigateTo();
12 | expect(page.getParagraphText()).toEqual('Welcome to app!');
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/packages/webcomponents/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | declare module '*.json';
2 |
3 | declare module 'preact/debug' {}
4 |
5 | declare module '@builder.io/react/dist/preact' {
6 | const react = require('@builder.io/react');
7 | export = react;
8 | }
9 | declare module '@builder.io/widgets/dist/preact' {
10 | const react = require('@builder.io/widgets');
11 | export = react;
12 | }
13 |
--------------------------------------------------------------------------------
/plugins/async-dropdown/src/helpers/mapperEvaluator.ts:
--------------------------------------------------------------------------------
1 | const safeEvaluate = (code: string, context: any = {}) => {
2 | let result = null;
3 | try {
4 | const fn = new Function(`return ${code}`)();
5 | result = fn(context);
6 | } catch (e) {
7 | console.error('safeEvaluate error: ', e);
8 | }
9 |
10 | return result;
11 | };
12 |
13 | export { safeEvaluate };
14 |
--------------------------------------------------------------------------------
/packages/angular/src/app/modules/builder/decorators/builder-component.dectorator.ts:
--------------------------------------------------------------------------------
1 | import { Builder, Component, Class } from '@builder.io/sdk';
2 |
3 | export interface AngularComponent extends Component {
4 | tag: string;
5 | }
6 |
7 | export function BuilderBlock(options: AngularComponent) {
8 | options.type = 'angular';
9 |
10 | return Builder.Component(options);
11 | }
12 |
--------------------------------------------------------------------------------
/packages/core/src/functions/get-top-level-domain.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Only gets one level up from hostname
3 | * wwww.example.com -> example.com
4 | * www.example.co.uk -> example.co.uk
5 | */
6 | export function getTopLevelDomain(host: string) {
7 | const parts = host.split('.');
8 | if (parts.length > 2) {
9 | return parts.slice(1).join('.');
10 | }
11 | return host;
12 | }
13 |
--------------------------------------------------------------------------------
/packages/sdks/src/functions/is-previewing.ts:
--------------------------------------------------------------------------------
1 | import { isBrowser } from './is-browser.js';
2 | import { isEditing } from './is-editing.js';
3 |
4 | export function isPreviewing() {
5 | if (!isBrowser()) {
6 | return false;
7 | }
8 |
9 | if (isEditing()) {
10 | return false;
11 | }
12 |
13 | return Boolean(location.search.indexOf('builder.preview=') !== -1);
14 | }
15 |
--------------------------------------------------------------------------------
/packages/webcomponents/README.md:
--------------------------------------------------------------------------------
1 | # Builder Webcomponents
2 |
3 | Display Builder page or component content on any tech stack
4 |
5 | ```html
6 |
7 |
8 | ```
9 |
10 | [View the full docs here](https://www.builder.io/c/docs/webcomponents-api)
11 |
--------------------------------------------------------------------------------
/examples/angular/e2e/app.e2e-spec.ts:
--------------------------------------------------------------------------------
1 | import { AppPage } from './app.po';
2 |
3 | describe('angular-test-site App', () => {
4 | let page: AppPage;
5 |
6 | beforeEach(() => {
7 | page = new AppPage();
8 | });
9 |
10 | it('should display welcome message', () => {
11 | page.navigateTo();
12 | expect(page.getParagraphText()).toEqual('Welcome to app!');
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/examples/react-design-system/src/pages/Collection.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { ProductsList } from '../components/ProductsList/ProductsList';
3 | import { BuilderComponent } from '@builder.io/react';
4 |
5 | export function Collection() {
6 | return (
7 | <>
8 |
9 |
10 | >
11 | );
12 | }
13 |
--------------------------------------------------------------------------------
/examples/vue/vue-2/jsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es5",
4 | "module": "esnext",
5 | "baseUrl": "./",
6 | "moduleResolution": "node",
7 | "paths": {
8 | "@/*": [
9 | "src/*"
10 | ]
11 | },
12 | "lib": [
13 | "esnext",
14 | "dom",
15 | "dom.iterable",
16 | "scripthost"
17 | ]
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/packages/commerce-plugin-tools/src/interfaces/builder-request.ts:
--------------------------------------------------------------------------------
1 | export interface BuilderRequest {
2 | '@type': '@builder.io/core:Request';
3 | request: {
4 | url: string;
5 | query?: { [key: string]: string };
6 | headers?: { [key: string]: string };
7 | method?: string;
8 | };
9 | options?: { [key: string]: any };
10 | bindings?: { [key: string]: string };
11 | }
12 |
--------------------------------------------------------------------------------
/packages/react/src/scripts/init-editing.ts:
--------------------------------------------------------------------------------
1 | import { version } from '../../package.json';
2 |
3 | if (typeof window !== 'undefined') {
4 | window.parent?.postMessage(
5 | {
6 | type: 'builder.isReactSdk',
7 | data: {
8 | value: true,
9 | supportsPatchUpdates: 'v3',
10 | priorVersion: version,
11 | },
12 | },
13 | '*'
14 | );
15 | }
16 |
--------------------------------------------------------------------------------
/starters/create-builder/nextjs/styles/globals.css:
--------------------------------------------------------------------------------
1 | html,
2 | body {
3 | padding: 0;
4 | margin: 0;
5 | font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
6 | Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
7 | }
8 |
9 | a {
10 | color: inherit;
11 | text-decoration: none;
12 | }
13 |
14 | * {
15 | box-sizing: border-box;
16 | }
17 |
--------------------------------------------------------------------------------
/examples/embed-starter-kit/plugin/src/constants/page-templates.ts:
--------------------------------------------------------------------------------
1 | import { BuilderElement } from '@builder.io/sdk'
2 |
3 | export const examplePageTemplate = {
4 | name: 'New page',
5 | query: [{ property: 'urlPath', operator: 'is', value: '/' }],
6 | data: {
7 | blocks: [
8 | // Optionally specify blocks JSON to pre-populate content with templates
9 | ],
10 | },
11 | }
12 |
--------------------------------------------------------------------------------
/examples/react-multipage-funnel/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Builder.io Multi step funnel
4 |
5 |
6 |
7 |
8 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/examples/vue/vue-storefront-2/helpers/cacheControl.js:
--------------------------------------------------------------------------------
1 | const cacheControl =
2 | values =>
3 | ({ res }) => {
4 | if (!process.server) return;
5 |
6 | const cacheControlValue = Object.entries(values)
7 | .map(([key, value]) => `${key}=${value}`)
8 | .join(',');
9 |
10 | res.setHeader('Cache-Control', cacheControlValue);
11 | };
12 |
13 | export default cacheControl;
14 |
--------------------------------------------------------------------------------
/packages/personalization-utils/configurator/src/get-attributes.ts:
--------------------------------------------------------------------------------
1 | import { createAdminApiClient } from '@builder.io/admin-sdk';
2 |
3 | export const getAttributes = async (privateKey: string) => {
4 | const adminSDK = createAdminApiClient(privateKey);
5 | const res = await adminSDK.query({
6 | settings: true,
7 | });
8 | return res.data?.settings.customTargetingAttributes;
9 | };
10 |
--------------------------------------------------------------------------------
/packages/plugin-loader/test/plugin-loader.test.ts:
--------------------------------------------------------------------------------
1 | import DummyClass from '../src/plugin-loader';
2 |
3 | /**
4 | * Dummy test
5 | */
6 | describe('Dummy test', () => {
7 | it('works if true is truthy', () => {
8 | expect(true).toBeTruthy();
9 | });
10 |
11 | it('DummyClass is instantiable', () => {
12 | expect(new DummyClass()).toBeInstanceOf(DummyClass);
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/packages/sdks/src/blocks/raw-text/raw-text.lite.tsx:
--------------------------------------------------------------------------------
1 | export interface RawTextProps {
2 | attributes?: any;
3 | text?: string;
4 | // builderBlock?: any;
5 | }
6 |
7 | export default function RawText(props: RawTextProps) {
8 | return (
9 |
13 | );
14 | }
15 |
--------------------------------------------------------------------------------
/packages/sdks/src/functions/get-block-properties.ts:
--------------------------------------------------------------------------------
1 | import { BuilderBlock } from '../types/builder-block.js';
2 |
3 | export function getBlockProperties(block: BuilderBlock) {
4 | return {
5 | ...block.properties,
6 | 'builder-id': block.id,
7 | class: [block.id, 'builder-block', block.class, block.properties?.class]
8 | .filter(Boolean)
9 | .join(' '),
10 | };
11 | }
12 |
--------------------------------------------------------------------------------
/packages/swift/src/Shared/Schemas/BuilderContent.swift:
--------------------------------------------------------------------------------
1 | // Schema for Builder content
2 | struct BuilderContent: Codable {
3 | var data = BuilderContentData()
4 | var screenshot: String? = nil
5 | }
6 |
7 | struct BuilderContentData: Codable {
8 | var blocks: [BuilderBlock] = []
9 | }
10 |
11 | struct BuilderContentList: Codable {
12 | var results: [BuilderContent] = []
13 | }
14 |
--------------------------------------------------------------------------------
/examples/angular-universal/src/app/app.server.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { ServerModule } from '@angular/platform-server';
3 |
4 | import { AppModule } from './app.module';
5 | import { AppComponent } from './app.component';
6 |
7 | @NgModule({
8 | imports: [AppModule, ServerModule],
9 | bootstrap: [AppComponent],
10 | })
11 | export class AppServerModule {}
12 |
--------------------------------------------------------------------------------
/packages/swift/src/macOS/macOS.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.files.user-selected.read-only
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/starters/react/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/examples/next-js-theme-ui/config/seo.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Next.JS with theme-ui starter",
3 | "titleTemplate": "%s - Demo",
4 | "description": "A starter kit for demo site with Builder.io and themes",
5 | "openGraph": {
6 | "type": "website",
7 | "locale": "en_IE",
8 | "url": "https://github.com/BuilderIO/builder",
9 | "site_name": "Builder.io + theme-ui + Next.js"
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/examples/svelte-design-system/src/routes/[...catchall].svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
8 |
9 |
10 |
11 |
12 |
13 |
20 |
--------------------------------------------------------------------------------
/packages/angular/src/app/modules/builder/directives/builder-content.directive.spec.ts:
--------------------------------------------------------------------------------
1 | import { BuilderContentDirective } from './builder-content.directive';
2 |
3 | describe('BuilderContentDirective', () => {
4 | it('should create an instance', () => {
5 | // const directive = new BuilderContentDirective();
6 | // expect(directive).toBeTruthy();
7 | expect(true).toBeTruthy();
8 | });
9 | });
10 |
--------------------------------------------------------------------------------
/packages/create-builder.io/src/vendor/prompts/util/strip.js:
--------------------------------------------------------------------------------
1 | export default function (str) {
2 | const pattern = [
3 | '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)',
4 | '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))',
5 | ].join('|');
6 |
7 | const RGX = new RegExp(pattern, 'g');
8 | return typeof str === 'string' ? str.replace(RGX, '') : str;
9 | }
10 |
--------------------------------------------------------------------------------
/packages/sdks/src/blocks/raw-text/component-info.ts:
--------------------------------------------------------------------------------
1 | import type { ComponentInfo } from '../../types/components';
2 |
3 | export const componentInfo: ComponentInfo = {
4 | name: 'Builder:RawText',
5 | hideFromInsertMenu: true,
6 | builtIn: true,
7 | inputs: [
8 | {
9 | name: 'text',
10 | bubble: true,
11 | type: 'longText',
12 | required: true,
13 | },
14 | ],
15 | };
16 |
--------------------------------------------------------------------------------
/examples/angular/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | AngularTestSite
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/vue/vue-3/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite App
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/vue/vue-storefront-2/shims-webpack.d.ts:
--------------------------------------------------------------------------------
1 | declare module 'webpack-hot-middleware' {
2 | const middleware: any;
3 | export interface Options {
4 | [proName: string]: any;
5 | }
6 |
7 | export interface ClientOptions {
8 | [proName: string]: any;
9 | }
10 |
11 | export interface MiddlewareOptions {
12 | [proName: string]: any;
13 | }
14 |
15 | export default middleware;
16 | }
17 |
--------------------------------------------------------------------------------
/examples/vue/vue-storefront-2/tests/e2e/fixtures/test-data/e2e-user-login.json:
--------------------------------------------------------------------------------
1 | {
2 | "Should successfully login": {
3 | "customer": {
4 | "password": "Vu3S70r3fr0n7!"
5 | }
6 | },
7 | "Incorrect credentials - should display an error": {
8 | "customer": {
9 | "password": "Vu3S70r3fr0n7!"
10 | },
11 | "errorMessage": "Account with the given credentials not found."
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/packages/angular/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Angular
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/packages/personalization-utils/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "rootDir": "src",
4 | "outDir": "dist",
5 | "module": "CommonJS",
6 | "target": "es6",
7 | "esModuleInterop": true,
8 | "strict": true,
9 | "declaration": true,
10 | "jsx": "react",
11 | "skipLibCheck": true
12 | },
13 | "include": ["./src"],
14 | "exclude": ["node_modules", "**/*.test.ts"]
15 | }
16 |
--------------------------------------------------------------------------------
/packages/sdks/src/functions/get-global-this.ts:
--------------------------------------------------------------------------------
1 | export function getGlobalThis(): any {
2 | if (typeof globalThis !== 'undefined') {
3 | return globalThis;
4 | }
5 | if (typeof window !== 'undefined') {
6 | return window;
7 | }
8 | if (typeof global !== 'undefined') {
9 | return global;
10 | }
11 | if (typeof self !== 'undefined') {
12 | return self;
13 | }
14 | return null;
15 | }
16 |
--------------------------------------------------------------------------------
/examples/vue/vue-storefront-2/tests/e2e/pages/utils/element.ts:
--------------------------------------------------------------------------------
1 | export function el(selector: string, children?: string): Cypress.Chainable {
2 | return children
3 | ? cy.get(`[data-e2e="${selector}"] ${children}`)
4 | : cy.get(`[data-e2e="${selector}"]`);
5 | }
6 |
7 | export function contains(selector: string, text: string): Cypress.Chainable {
8 | return cy.contains(`[data-e2e="${selector}"]`, text);
9 | }
10 |
--------------------------------------------------------------------------------
/packages/amp/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | branches:
3 | only:
4 | - master
5 | - /^greenkeeper/.*$/
6 | cache:
7 | yarn: true
8 | directories:
9 | - node_modules
10 | notifications:
11 | email: false
12 | node_js:
13 | - node
14 | script:
15 | - npm run test:prod && npm run build
16 | after_success:
17 | - npm run report-coverage
18 | - npm run deploy-docs
19 | - npm run semantic-release
20 |
--------------------------------------------------------------------------------
/packages/android/sdk/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | gradlePluginPortal()
4 | google()
5 | mavenCentral()
6 | }
7 | }
8 | dependencyResolutionManagement {
9 | repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
10 | repositories {
11 | google()
12 | mavenCentral()
13 | }
14 | }
15 | rootProject.name = "My Application"
16 | include ':app'
17 |
--------------------------------------------------------------------------------
/packages/email/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | branches:
3 | only:
4 | - master
5 | - /^greenkeeper/.*$/
6 | cache:
7 | yarn: true
8 | directories:
9 | - node_modules
10 | notifications:
11 | email: false
12 | node_js:
13 | - node
14 | script:
15 | - npm run test:prod && npm run build
16 | after_success:
17 | - npm run report-coverage
18 | - npm run deploy-docs
19 | - npm run semantic-release
20 |
--------------------------------------------------------------------------------
/packages/fiddle/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | branches:
3 | only:
4 | - master
5 | - /^greenkeeper/.*$/
6 | cache:
7 | yarn: true
8 | directories:
9 | - node_modules
10 | notifications:
11 | email: false
12 | node_js:
13 | - node
14 | script:
15 | - npm run test:prod && npm run build
16 | after_success:
17 | - npm run report-coverage
18 | - npm run deploy-docs
19 | - npm run semantic-release
20 |
--------------------------------------------------------------------------------
/packages/react/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | branches:
3 | only:
4 | - master
5 | - /^greenkeeper/.*$/
6 | cache:
7 | yarn: true
8 | directories:
9 | - node_modules
10 | notifications:
11 | email: false
12 | node_js:
13 | - node
14 | script:
15 | - npm run test:prod && npm run build
16 | after_success:
17 | - npm run report-coverage
18 | - npm run deploy-docs
19 | - npm run semantic-release
20 |
--------------------------------------------------------------------------------
/packages/react/src/hooks/useIsPreviewing.ts:
--------------------------------------------------------------------------------
1 | import { useEffect, useState } from 'react';
2 | import { Builder } from '@builder.io/sdk';
3 |
4 | export function useIsPreviewing() {
5 | const [isPreviewing, setIsPreviewing] = useState(false);
6 |
7 | useEffect(() => {
8 | if (Builder.isEditing || Builder.isPreviewing) {
9 | setIsPreviewing(true);
10 | }
11 | }, []);
12 |
13 | return isPreviewing;
14 | }
15 |
--------------------------------------------------------------------------------
/packages/widgets/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | branches:
3 | only:
4 | - master
5 | - /^greenkeeper/.*$/
6 | cache:
7 | yarn: true
8 | directories:
9 | - node_modules
10 | notifications:
11 | email: false
12 | node_js:
13 | - node
14 | script:
15 | - npm run test:prod && npm run build
16 | after_success:
17 | - npm run report-coverage
18 | - npm run deploy-docs
19 | - npm run semantic-release
20 |
--------------------------------------------------------------------------------
/starters/react/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
4 | 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
5 | -webkit-font-smoothing: antialiased;
6 | -moz-osx-font-smoothing: grayscale;
7 | }
8 |
9 | code {
10 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
11 | }
12 |
--------------------------------------------------------------------------------
/examples/angular-universal/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Angular Test Site
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/svelte-design-system/src/components/Button/Button.svelte:
--------------------------------------------------------------------------------
1 |
9 |
10 |
--------------------------------------------------------------------------------
/examples/vue/vue-storefront-2/tests/e2e/fixtures/responses/getOrdersWithOffset.json:
--------------------------------------------------------------------------------
1 | {
2 | "data": {
3 | "me": {
4 | "orders": {
5 | "results": [],
6 | "total": 21,
7 | "offset": 10,
8 | "count": 10,
9 | "__typename": "OrderQueryResult"
10 | },
11 | "__typename": "Me"
12 | }
13 | },
14 | "loading": false,
15 | "networkStatus": 7,
16 | "stale": false
17 | }
18 |
--------------------------------------------------------------------------------
/packages/personalization-utils/configurator/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "rootDir": "src",
4 | "outDir": "dist",
5 | "module": "CommonJS",
6 | "target": "es6",
7 | "esModuleInterop": true,
8 | "strict": true,
9 | "declaration": true,
10 | "jsx": "react",
11 | "skipLibCheck": true
12 | },
13 | "include": ["./src"],
14 | "exclude": ["node_modules", "**/*.test.ts"]
15 | }
16 |
--------------------------------------------------------------------------------
/packages/swift/src/Package.resolved:
--------------------------------------------------------------------------------
1 | {
2 | "object": {
3 | "pins": [
4 | {
5 | "package": "SwiftyJSON",
6 | "repositoryURL": "https://github.com/SwiftyJSON/SwiftyJSON.git",
7 | "state": {
8 | "branch": null,
9 | "revision": "2b6054efa051565954e1d2b9da831680026cd768",
10 | "version": "4.3.0"
11 | }
12 | }
13 | ]
14 | },
15 | "version": 1
16 | }
17 |
--------------------------------------------------------------------------------
/examples/embed-starter-kit/admin/helpers/auth0.ts:
--------------------------------------------------------------------------------
1 | import { initAuth0 } from '@auth0/nextjs-auth0'
2 |
3 | export default initAuth0({
4 | secret: process.env.AUTH0_SECRET!,
5 | clientID: process.env.AUTH0_CLIENT_ID,
6 | clientSecret: process.env.AUTH0_CLIENT_SECRET,
7 | issuerBaseURL: process.env.AUTH0_ISSUER_BASE_URL,
8 | baseURL: process.env.BASE_URL,
9 | routes: {
10 | callback: `/api/callback`,
11 | },
12 | })
13 |
--------------------------------------------------------------------------------
/examples/storybook/.storybook/preview.js:
--------------------------------------------------------------------------------
1 | import { addParameters, addDecorator } from '@storybook/react';
2 | import { BuilderComponent } from '@builder.io/react';
3 | import { builderDecorator } from '@builder.io/storybook';
4 | import '../src/builder-settings';
5 |
6 | addDecorator(builderDecorator);
7 |
8 | addParameters({
9 | builder: {
10 | component: BuilderComponent,
11 | navigateOnDblClick: true,
12 | },
13 | });
14 |
--------------------------------------------------------------------------------
/packages/android/sdk/app/src/main/java/com/example/myapplication/ui/theme/Shape.kt:
--------------------------------------------------------------------------------
1 | package com.example.myapplication.ui.theme
2 |
3 | import androidx.compose.foundation.shape.RoundedCornerShape
4 | import androidx.compose.material.Shapes
5 | import androidx.compose.ui.unit.dp
6 |
7 | val Shapes = Shapes(
8 | small = RoundedCornerShape(4.dp),
9 | medium = RoundedCornerShape(4.dp),
10 | large = RoundedCornerShape(0.dp)
11 | )
--------------------------------------------------------------------------------
/packages/sdks/scripts/add-resolutions.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # You'll need to install `jq`: https://stedolan.github.io/jq/
3 |
4 | # Sets `@builder.io/mitosis-cli` resolution symlinks in `package.json`. Assumes `mitosis` repo lives besides this one.
5 | echo "$(jq '.resolutions."@builder.io/mitosis-cli" = "link:../../../mitosis/packages/cli" | .resolutions."@builder.io/mitosis" = "link:../../../mitosis/packages/core"' package.json)" >package.json
6 |
--------------------------------------------------------------------------------
/packages/swift/src/testing.xcworkspace/xcshareddata/swiftpm/Package.resolved:
--------------------------------------------------------------------------------
1 | {
2 | "pins" : [
3 | {
4 | "identity" : "swiftyjson",
5 | "kind" : "remoteSourceControl",
6 | "location" : "https://github.com/SwiftyJSON/SwiftyJSON",
7 | "state" : {
8 | "revision" : "b3dcd7dbd0d488e1a7077cb33b00f2083e382f07",
9 | "version" : "5.0.1"
10 | }
11 | }
12 | ],
13 | "version" : 2
14 | }
15 |
--------------------------------------------------------------------------------
/packages/webcomponents/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | branches:
3 | only:
4 | - master
5 | - /^greenkeeper/.*$/
6 | cache:
7 | yarn: true
8 | directories:
9 | - node_modules
10 | notifications:
11 | email: false
12 | node_js:
13 | - node
14 | script:
15 | - npm run test:prod && npm run build
16 | after_success:
17 | - npm run report-coverage
18 | - npm run deploy-docs
19 | - npm run semantic-release
20 |
--------------------------------------------------------------------------------
/starters/react/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | *.log
3 | dist
4 | test-lib/**/*.js
5 | coverage
6 | .history
7 | .nyc_output
8 | .idea
9 | .vscode
10 | .next
11 | firebase.json
12 | temp
13 | yarn-error.log
14 | .build
15 | Pods/
16 |
17 |
18 | **/.pnp.*
19 | **/.yarn/*
20 | !**/.yarn/patches
21 | !**/.yarn/plugins
22 | !**/.yarn/releases
23 | !**/.yarn/sdks
24 | !**/.yarn/versions
25 |
26 | # macOS
27 | .DS_Store
28 |
29 |
30 | .cache
31 | .rpt2_cache/
32 |
--------------------------------------------------------------------------------
/examples/react/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: sans-serif;
3 | }
4 |
5 | header {
6 | display: flex;
7 | padding: 10px;
8 | }
9 |
10 | .links {
11 | margin: auto;
12 | }
13 |
14 | main {
15 | padding: 10px;
16 | }
17 |
18 | .logo {
19 | font-size: 18px;
20 | letter-spacing: 2px;
21 | }
22 |
23 | .link {
24 | margin-right: 15px;
25 | }
26 |
27 | .loading {
28 | padding: 50px;
29 | text-align: center;
30 | }
31 |
--------------------------------------------------------------------------------
/packages/app-context/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@builder.io/app-context",
3 | "version": "1.0.1-1",
4 | "description": "Builder.io plugin application context",
5 | "main": "index.js",
6 | "scripts": {
7 | "release:dev": "npm version prerelease --no-git-tag-version && ALLOW_PUBLISH=true npm publish --tag dev"
8 | },
9 | "devDependencies": {
10 | "@builder.io/sdk": "^1.1.26",
11 | "react": "^18.0.0"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/packages/email/src/components/EmailPreview.tsx:
--------------------------------------------------------------------------------
1 | import { resetStyles } from '../constants/reset-styles';
2 | import React from 'react';
3 |
4 | interface EmailPreviewProps {}
5 |
6 | export class EmailPreview extends React.Component {
7 | render() {
8 | return (
9 |
10 |
11 | {this.props.children}
12 |
13 | );
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/packages/sdks/scripts/remove-resolutions.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # You'll need to install `jq`: https://stedolan.github.io/jq/
3 |
4 | # Remove `@builder.io/mitosis-cli` resolution from the list of resolutions in `package.json``
5 | # This is needed in CI since we don't currently have the mitosis repo locally existing in this one.
6 | echo "$(jq 'del(.resolutions."@builder.io/mitosis-cli",.resolutions."@builder.io/mitosis")' package.json)" >package.json
7 |
--------------------------------------------------------------------------------
/examples/embed-starter-kit/site/blocks/header/cart/cart.builder.ts:
--------------------------------------------------------------------------------
1 | import dynamic from 'next/dynamic'
2 | import { Builder } from '@builder.io/react'
3 |
4 | Builder.registerComponent(
5 | dynamic(() => import('./cart')),
6 | {
7 | name: 'Cart',
8 | description: 'Cart button',
9 | image:
10 | 'https://cdn.builder.io/api/v1/image/assets%2Fe7eb284a1bc549c8856f32d1fc7a44cf%2F32c90ca2aa1a4812bc9314bae1b795c6',
11 | }
12 | )
13 |
--------------------------------------------------------------------------------
/examples/next-js-builder-site/src/constants/breakpoints.ts:
--------------------------------------------------------------------------------
1 | export const xLargeBreakpoint = 1450;
2 | export const xLargeBreakpointMediaQuery = `@media (max-width: ${xLargeBreakpoint}px)`;
3 |
4 | export const largeBreakpoint = 1250;
5 | export const largeBreakpointMediaQuery = `@media (max-width: ${largeBreakpoint}px)`;
6 |
7 | export const mediumBreakpoint = 800;
8 | export const mediumBreakpointMediaQuery = `@media (max-width: ${mediumBreakpoint}px)`;
9 |
--------------------------------------------------------------------------------
/examples/plain-js/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: sans-serif;
3 | }
4 |
5 | header {
6 | display: flex;
7 | padding: 10px;
8 | }
9 |
10 | .links {
11 | margin: auto;
12 | }
13 |
14 | main {
15 | padding: 10px;
16 | }
17 |
18 | .logo {
19 | font-size: 18px;
20 | letter-spacing: 2px;
21 | }
22 |
23 | .link {
24 | margin-right: 15px;
25 | }
26 |
27 | .loading {
28 | padding: 100px;
29 | text-align: center;
30 | }
31 |
--------------------------------------------------------------------------------
/examples/solid-js/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/examples/svelte/sveltekit/src/app.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | %sveltekit.head%
9 |
10 |
11 | %sveltekit.body%
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/vue/vue-storefront-2/tests/e2e/utils/data-generator.ts:
--------------------------------------------------------------------------------
1 | const generator = {
2 | get email(): string {
3 | return `cypress.${Date.now()}@vuestorefront.test`;
4 | },
5 |
6 | get uuid(): string {
7 | return 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx'.replace(/[x]/g, () => {
8 | const random = Math.floor(Math.random() * 16);
9 | return random.toString(16);
10 | });
11 | },
12 | };
13 |
14 | export default generator;
15 |
--------------------------------------------------------------------------------
/packages/fiddle/test/builder-fiddle.test.ts:
--------------------------------------------------------------------------------
1 | // TODO
2 | // import DummyClass from "../src/builder-webcomponents"
3 |
4 | // /**
5 | // * Dummy test
6 | // */
7 | // describe("Dummy test", () => {
8 | // it("works if true is truthy", () => {
9 | // expect(true).toBeTruthy()
10 | // })
11 |
12 | // it("DummyClass is instantiable", () => {
13 | // expect(new DummyClass()).toBeInstanceOf(DummyClass)
14 | // })
15 | // })
16 | //
17 |
--------------------------------------------------------------------------------
/packages/sdks/src/helpers/css.ts:
--------------------------------------------------------------------------------
1 | import { camelToKebabCase } from '../functions/camel-to-kebab-case';
2 |
3 | export const convertStyleMaptoCSS = (
4 | style: Partial
5 | ): string => {
6 | const cssProps = Object.entries(style).map(([key, value]) => {
7 | if (typeof value === 'string') {
8 | return `${camelToKebabCase(key)}: ${value};`;
9 | }
10 | });
11 |
12 | return cssProps.join('\n');
13 | };
14 |
--------------------------------------------------------------------------------
/examples/angular/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | // The file contents for the current environment will overwrite these during build.
2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do
3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead.
4 | // The list of which env maps to which file can be found in `.angular-cli.json`.
5 |
6 | export const environment = {
7 | production: false,
8 | };
9 |
--------------------------------------------------------------------------------
/examples/angular/src/main.ts:
--------------------------------------------------------------------------------
1 | import { enableProdMode } from '@angular/core';
2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3 |
4 | import { AppModule } from './app/app.module';
5 | import { environment } from './environments/environment';
6 |
7 | if (environment.production) {
8 | enableProdMode();
9 | }
10 |
11 | platformBrowserDynamic()
12 | .bootstrapModule(AppModule)
13 | .catch(err => console.log(err));
14 |
--------------------------------------------------------------------------------
/examples/vue/vue-3/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { fileURLToPath, URL } from 'url';
2 |
3 | import { defineConfig } from 'vite';
4 | import vue from '@vitejs/plugin-vue';
5 | import vueJsx from '@vitejs/plugin-vue-jsx';
6 |
7 | // https://vitejs.dev/config/
8 | export default defineConfig({
9 | plugins: [vue(), vueJsx()],
10 | resolve: {
11 | alias: {
12 | '@': fileURLToPath(new URL('./src', import.meta.url)),
13 | },
14 | },
15 | });
16 |
--------------------------------------------------------------------------------
/examples/vue/vue-storefront-2/middleware/README.md:
--------------------------------------------------------------------------------
1 | # MIDDLEWARE
2 |
3 | **This directory is not required, you can delete it if you don't want to use it.**
4 |
5 | This directory contains your application middleware.
6 | Middleware let you define custom functions that can be run before rendering either a page or a group of pages.
7 |
8 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing#middleware).
9 |
--------------------------------------------------------------------------------
/packages/angular/src/app/app.server.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { ServerModule, ServerTransferStateModule } from '@angular/platform-server';
3 |
4 | import { AppModule } from './app.module';
5 | import { AppComponent } from './app.component';
6 |
7 | @NgModule({
8 | imports: [AppModule, ServerModule, ServerTransferStateModule],
9 |
10 | bootstrap: [AppComponent],
11 | })
12 | export class AppServerModule {}
13 |
--------------------------------------------------------------------------------
/packages/angular/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | // The file contents for the current environment will overwrite these during build.
2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do
3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead.
4 | // The list of which env maps to which file can be found in `.angular-cli.json`.
5 |
6 | export const environment = {
7 | production: false,
8 | };
9 |
--------------------------------------------------------------------------------