Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix frameworks using constant context value #397

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
3ec845a
fix(react): dont use iframe context constants
artmanque Feb 25, 2022
d97a8ee
fix(angular): dont use iframe context constants
artmanque Feb 25, 2022
a3efdf6
fix(angular2): dont use iframe context constants
artmanque Feb 25, 2022
afe8129
fix(vue): dont use iframe context constants
artmanque Feb 25, 2022
71b5912
fix(vue3): dont use iframe context constants
artmanque Feb 25, 2022
c70e06f
fix: update dist/zoid.frameworks.js
artmanque Feb 25, 2022
eb08a0c
fix: remove prepare script temporary
artmanque Feb 25, 2022
7a55ed4
feat(context): context prop | add contextPropType
artmanque Mar 7, 2022
be5953e
feat: angular driver uses context prop
artmanque Mar 7, 2022
2041c65
feat: angular2 driver uses context prop
artmanque Mar 7, 2022
72e6cce
feat: react driver uses context prop
artmanque Mar 7, 2022
8703b2c
feat: vue driver uses context prop
artmanque Mar 7, 2022
a3396a2
feat: vue3 driver uses context prop
artmanque Mar 7, 2022
d841cd2
feat: context prop | update build dist dir
artmanque Mar 7, 2022
732f2c4
docs: add note for defaultContext <> context
artmanque Mar 7, 2022
8529789
docs: add prop `context` on parent-props
artmanque Mar 7, 2022
ee9cbb6
refactor: add const MyLoginZoidComponentDef
artmanque Mar 7, 2022
a9e618d
fix: dimensions demo/advanced/props
artmanque Mar 7, 2022
1538dfc
fix: dimensions demo/advanced/react-end-to-end
artmanque Mar 7, 2022
6c08183
fix: dimensions demo/advanced/remote
artmanque Mar 7, 2022
92fe116
fix: dimensions demo/advanced/remote-popup
artmanque Mar 7, 2022
86ccf91
refactor: login def demo/basic/iframe
artmanque Mar 7, 2022
0ee6d46
fix: dimensions demo/basic/popup
artmanque Mar 7, 2022
cc39d5f
fix: dimensions demo/frameworks/angular
artmanque Mar 7, 2022
ffc329b
fix: dimensions demo/frameworks/angular2
artmanque Mar 7, 2022
a8c470f
fix: dimensions demo/frameworks/react
artmanque Mar 7, 2022
a1f7d1b
fix: dimensions demo/frameworks/vue3
artmanque Mar 7, 2022
eb6cb07
fix: dimensions demo/frameworks/vue
artmanque Mar 7, 2022
63ecb6e
fix: vue.component is not a function
artmanque Mar 7, 2022
22f32ae
fix: dimensions demo/frameworks/angular2_Typescript
artmanque Mar 7, 2022
54c3f3c
fix: npm package paths angular2_Typescript/config
artmanque Mar 7, 2022
eb1beb7
Revert "fix: remove prepare script temporary"
artmanque Mar 7, 2022
f28473b
Merge pull request #1 from artmanque/master
artmanque Mar 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions demo/advanced/props/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<link rel="stylesheet" href="../../common/index.css" />

<script src="../../../dist/zoid.js"></script>
<script src="../../common/LoginZoidComponentDef.js"></script>
<script src="./login.js"></script>
</head>

Expand Down
1 change: 1 addition & 0 deletions demo/advanced/props/login.htm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<!-- Pull in zoid and the login component we defined -->

<script src="../../../dist/zoid.js"></script>
<script src="../../common/LoginZoidComponentDef.js"></script>
<script src="./login.js"></script>
</head>

Expand Down
25 changes: 1 addition & 24 deletions demo/advanced/props/login.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,2 @@

window.MyLoginZoidComponent = zoid.create({

// The html tag used to render my component

tag: 'my-login-component',

// The url that will be loaded in the iframe or popup, when someone includes my component on their page

url: new URL('login.htm', window.location.href).href,

// The properties they can (or must) pass down to my component

props: {

prefilledEmail: {
type: 'string',
required: false
},

onLogin: {
type: 'function'
}
}
});
window.MyLoginZoidComponent = zoid.create(MyLoginZoidComponentDef);
3 changes: 2 additions & 1 deletion demo/advanced/react-end-to-end/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.38/browser.js"></script>

<script src="../../../dist/zoid.frameworks.js"></script>
<script src="../../common/LoginZoidComponentDef.js"></script>
<script src="./login.js"></script>
</head>

Expand All @@ -17,7 +18,7 @@

<script type="text/babel">

let LoginZoidReactComponent = LoginZoidComponent.driver('react', {
let LoginZoidReactComponent = MyLoginZoidComponent.driver('react', {
React: window.React,
ReactDOM: window.ReactDOM
});
Expand Down
1 change: 1 addition & 0 deletions demo/advanced/react-end-to-end/login.htm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.38/browser.js"></script>

<script src="../../../dist/zoid.frameworks.js"></script>
<script src="../../common/LoginZoidComponentDef.js"></script>
<script src="./login.js"></script>
</head>

Expand Down
11 changes: 1 addition & 10 deletions demo/advanced/react-end-to-end/login.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@

window.LoginZoidComponent = zoid.create({

// The html tag used to render my component

tag: 'my-login-component',

// The url that will be loaded in the iframe or popup, when someone includes my component on their page

url: new URL('login.htm', window.location.href).href
});
window.MyLoginZoidComponent = zoid.create(MyLoginZoidComponentDef);
1 change: 1 addition & 0 deletions demo/advanced/remote-popup/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<script src="../../../dist/zoid.js"></script>

<script src="./login-button.js"></script>
<script src="../../common/LoginZoidComponentDef.js"></script>
<script src="./login.js"></script>
</head>

Expand Down
1 change: 1 addition & 0 deletions demo/advanced/remote-popup/login-button.htm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<script src="../../../dist/zoid.js"></script>

<script src="./login-button.js"></script>
<script src="../../common/LoginZoidComponentDef.js"></script>
<script src="./login.js"></script>
</head>

Expand Down
1 change: 1 addition & 0 deletions demo/advanced/remote-popup/login.htm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<!-- Pull in zoid and the login component we defined -->

<script src="../../../dist/zoid.js"></script>
<script src="../../common/LoginZoidComponentDef.js"></script>
<script src="./login.js"></script>
</head>

Expand Down
11 changes: 1 addition & 10 deletions demo/advanced/remote-popup/login.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@

window.MyLoginZoidComponent = zoid.create({

// The html tag used to render my component

tag: 'my-login-component',

// The url that will be loaded in the iframe or popup, when someone includes my component on their page

url: new URL('login.htm', window.location.href).href
});
window.MyLoginZoidComponent = zoid.create(MyLoginZoidComponentDef);
1 change: 1 addition & 0 deletions demo/advanced/remote/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<script src="../../../dist/zoid.js"></script>

<script src="./login-button.js"></script>
<script src="../../common/LoginZoidComponentDef.js"></script>
<script src="./login.js"></script>
</head>

Expand Down
1 change: 1 addition & 0 deletions demo/advanced/remote/login-button.htm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<script src="../../../dist/zoid.js"></script>

<script src="./login-button.js"></script>
<script src="../../common/LoginZoidComponentDef.js"></script>
<script src="./login.js"></script>
</head>

Expand Down
1 change: 1 addition & 0 deletions demo/advanced/remote/login.htm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<!-- Pull in zoid and the login component we defined -->

<script src="../../../dist/zoid.js"></script>
<script src="../../common/LoginZoidComponentDef.js"></script>
<script src="./login.js"></script>
</head>

Expand Down
11 changes: 1 addition & 10 deletions demo/advanced/remote/login.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@

window.MyLoginZoidComponent = zoid.create({

// The html tag used to render my component

tag: 'my-login-component',

// The url that will be loaded in the iframe or popup, when someone includes my component on their page

url: new URL('login.htm', window.location.href).href
});
window.MyLoginZoidComponent = zoid.create(MyLoginZoidComponentDef);
1 change: 1 addition & 0 deletions demo/basic/iframe/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<link rel="stylesheet" href="../../common/index.css" />

<script src="../../../dist/zoid.js"></script>
<script src="../../common/LoginZoidComponentDef.js"></script>
<script src="./login.js"></script>
</head>

Expand Down
1 change: 1 addition & 0 deletions demo/basic/iframe/login.htm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<!-- Pull in zoid and the login component we defined -->

<script src="../../../dist/zoid.js"></script>
<script src="../../common/LoginZoidComponentDef.js"></script>
<script src="./login.js"></script>
</head>

Expand Down
15 changes: 1 addition & 14 deletions demo/basic/iframe/login.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,2 @@

window.MyLoginZoidComponent = zoid.create({
dimensions: {
width: '300px',
height: '150px',
},

// The html tag used to render my component

tag: 'my-login-component',

// The url that will be loaded in the iframe or popup, when someone includes my component on their page

url: new URL('login.htm', window.location.href).href
});
window.MyLoginZoidComponent = zoid.create(MyLoginZoidComponentDef);
1 change: 1 addition & 0 deletions demo/basic/popup/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

<script src="https://unpkg.com/[email protected]/dist/jsx-pragmatic.js"></script>
<script src="../../../dist/zoid.js"></script>
<script src="./../../common/LoginZoidComponentDef.js"></script>
<script src="./login.js"></script>
</head>

Expand Down
1 change: 1 addition & 0 deletions demo/basic/popup/login.htm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<!-- Pull in zoid and the login component we defined -->

<script src="../../../dist/zoid.js"></script>
<script src="./../../common/LoginZoidComponentDef.js"></script>
<script src="./login.js"></script>
</head>

Expand Down
15 changes: 1 addition & 14 deletions demo/basic/popup/login.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@

window.MyLoginZoidComponent = zoid.create({

// The html tag used to render my component

tag: 'my-login-component',

// The url that will be loaded in the iframe or popup, when someone includes my component on their page

url: new URL('login.htm', window.location.href).href,

dimensions: {
width: '300px',
height: '150px'
},
...MyLoginZoidComponentDef,

// The background overlay

containerTemplate: ({ uid, tag, context, focus, close, doc }) => {

function closeComponent(event) {
Expand Down
16 changes: 16 additions & 0 deletions demo/common/LoginZoidComponentDef.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const MyLoginZoidComponentDef = {
// The html tag used to render my component
tag: 'my-login-component',
// The url that will be loaded in the iframe or popup, when someone includes my component on their page
url: new URL('login.htm', window.location.href).href,
props: {
prefilledEmail: {
type: 'string',
required: false
},
onLogin: {
type: 'function'
}
},
dimensions: { width: '300px', height: '150px' }
};
1 change: 1 addition & 0 deletions demo/frameworks/angular/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.8/angular.js"></script>

<script src="../../../dist/zoid.frameworks.js"></script>
<script src="../../common/LoginZoidComponentDef.js"></script>
<script src="./login.js"></script>

<script>
Expand Down
1 change: 1 addition & 0 deletions demo/frameworks/angular/login.htm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<!-- Pull in zoid and the login component we defined -->

<script src="../../../dist/zoid.frameworks.js"></script>
<script src="../../common/LoginZoidComponentDef.js"></script>
<script src="./login.js"></script>
</head>

Expand Down
11 changes: 1 addition & 10 deletions demo/frameworks/angular/login.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@

window.MyLoginZoidComponent = zoid.create({

// The html tag used to render my component

tag: 'my-login-component',

// The url that will be loaded in the iframe or popup, when someone includes my component on their page

url: new URL('login.htm', window.location.href).href
});
window.MyLoginZoidComponent = zoid.create(MyLoginZoidComponentDef);
1 change: 1 addition & 0 deletions demo/frameworks/angular2/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<script src="https://npmcdn.com/@angular/[email protected]/bundles/platform-browser.umd.js"></script>
<script src="https://npmcdn.com/@angular/[email protected]/bundles/platform-browser-dynamic.umd.js"></script>
<script src="../../../dist/zoid.frameworks.js"></script>
<script src="../../common/LoginZoidComponentDef.js"></script>
<script src="./login.js"></script>
</head>

Expand Down
1 change: 1 addition & 0 deletions demo/frameworks/angular2/login.htm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<!-- Pull in zoid and the login component we defined -->

<script src="../../../dist/zoid.frameworks.js"></script>
<script src="../../common/LoginZoidComponentDef.js"></script>
<script src="./login.js"></script>
</head>

Expand Down
11 changes: 1 addition & 10 deletions demo/frameworks/angular2/login.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@

window.MyLoginZoidComponent = zoid.create({

// The html tag used to render my component

tag: 'my-login-component',

// The url that will be loaded in the iframe or popup, when someone includes my component on their page

url: new URL('login.htm', window.location.href).href
});
window.MyLoginZoidComponent = zoid.create(MyLoginZoidComponentDef);
12 changes: 6 additions & 6 deletions demo/frameworks/angular2_TypeScript/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ System.config({
map: {

'app': './',
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
'rxjs': 'npm:rxjs',
'@angular/core': 'npm:@angular/core@2/bundles/core.umd.js',
'@angular/common': 'npm:@angular/common@2/bundles/common.umd.js',
'@angular/compiler': 'npm:@angular/compiler@2/bundles/compiler.umd.js',
'@angular/platform-browser': 'npm:@angular/platform-browser@2/bundles/platform-browser.umd.js',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic@2/bundles/platform-browser-dynamic.umd.js',
'rxjs': 'npm:rxjs@5.0.0',
'typescript': 'npm:[email protected]/lib/typescript.js'
},
// packages defines our app package
Expand Down
3 changes: 2 additions & 1 deletion demo/frameworks/angular2_TypeScript/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
<script src="https://unpkg.com/zone.js/dist/long-stack-trace-zone.js"></script>
<script src="https://unpkg.com/[email protected]/Reflect.js"></script>
<script src="https://unpkg.com/[email protected]/dist/system.js"></script>
<script src="config.js"></script>
<script src="./config.js"></script>
<script src="../../../dist/zoid.frameworks.js"></script>
<script src="../../common/LoginZoidComponentDef.js"></script>
<script src="./login.js"></script>
<script>
System.import('app')
Expand Down
1 change: 1 addition & 0 deletions demo/frameworks/angular2_TypeScript/login.htm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<!-- Pull in zoid and the login component we defined -->

<script src="../../../dist/zoid.frameworks.js"></script>
<script src="../../common/LoginZoidComponentDef.js"></script>
<script src="./login.js"></script>
</head>

Expand Down
24 changes: 1 addition & 23 deletions demo/frameworks/angular2_TypeScript/login.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,2 @@

window.MyLoginZoidComponent = zoid.create({

// The html tag used to render my component

tag: 'my-login-component',

// The url that will be loaded in the iframe or popup, when someone includes my component on their page

url: new URL('login.htm', window.location.href).href,

props: {

prefilledEmail: {
type: 'string',
required: false
},

onLogin: {
type: 'function',
required: true
}
}
});
window.MyLoginZoidComponent = zoid.create(MyLoginZoidComponentDef);
1 change: 1 addition & 0 deletions demo/frameworks/react/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.38/browser.js"></script>

<script src="../../../dist/zoid.frameworks.js"></script>
<script src="../../common/LoginZoidComponentDef.js"></script>
<script src="./login.js"></script>
</head>

Expand Down
1 change: 1 addition & 0 deletions demo/frameworks/react/login.htm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<!-- Pull in zoid and the login component we defined -->

<script src="../../../dist/zoid.frameworks.js"></script>
<script src="../../common/LoginZoidComponentDef.js"></script>
<script src="./login.js"></script>
</head>

Expand Down
11 changes: 1 addition & 10 deletions demo/frameworks/react/login.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@

window.MyLoginZoidComponent = zoid.create({

// The html tag used to render my component

tag: 'my-login-component',

// The url that will be loaded in the iframe or popup, when someone includes my component on their page

url: new URL('login.htm', window.location.href).href
});
window.MyLoginZoidComponent = zoid.create(MyLoginZoidComponentDef);
Loading