Skip to content

Commit 43662aa

Browse files
committed
Merge branch 'main' of https://github.com/gridaco/designto-code into support-text-shadow
2 parents 79254c4 + 279497c commit 43662aa

68 files changed

Lines changed: 2735 additions & 5127 deletions

File tree

Some content is hidden

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

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@
1313
[submodule "ui/editor-ui"]
1414
path = ui/editor-ui
1515
url = https://github.com/bridgedxyz/reflect-editor-ui
16+
[submodule "editor-packages/base-sdk"]
17+
path = editor-packages/base-sdk
18+
url = https://github.com/gridaco/base-sdk

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"**/node_modules": true,
1212
"**/bower_components": true,
1313
"**/*.code-search": true,
14-
"yarn.lock": true
14+
"**/yarn.lock": true,
15+
"**/.next": true
1516
}
1617
}

editor-packages/README.md

Whitespace-only changes.

editor-packages/base-sdk

Submodule base-sdk added at 533b4df
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# A Live session listener app
2+
3+
## From assistant
4+
5+
## .env setup
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function connect() {
2+
throw "";
3+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "@editor-app/live-session",
3+
"version": "0.0.0",
4+
"private": false,
5+
"main": "index.ts",
6+
"dependencies": {
7+
"pusher-js": "^7.0.3"
8+
}
9+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016-2018 Samuel Reed
4+
Copyright (c) 2021 Grida Inc, softmarshmallow
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# PIP - Picture in picture
2+
3+
Picture in picture mode of preview inside the viewport for viewing UI Previews in more ux friendly way.
4+
5+
# Resizable-PIP
6+
7+
A resizable picture-in-picture component for React.
8+
9+
```js
10+
<ResizablePIP>
11+
<div>I can be resized and moved around!</div>
12+
</ResizablePIP>
13+
```
14+
15+
![](ResizablePIP.gif)
16+
17+
### Installing
18+
19+
```bash
20+
$ yarn add @code-editor/preview-pip
21+
```
22+
23+
### Usage
24+
25+
This package has two major exports:
26+
27+
- [`<ResizablePIP>`](/lib/resizable-pip.tsx): A simple PIP component that can be resized and moved around.
28+
- [`<PIP>`](/lib/pip.tsx): A simple PIP component that does not receive props and cannot be resized. Used as a base for the ResizablePIP component.
29+
30+
## `<ResizablePIP>`
31+
32+
A `<ResizablePIP>` element wraps an existing element and extends it with the ability to be resized and moved around, above all content in the app.
33+
34+
### ResizablePIP Usage
35+
36+
View the [source](/src/lib/components/ResizablePIP.jsx) for more.
37+
38+
```js
39+
import { ResizablePIP } from "@code-editor/preview-pip";
40+
41+
function App() {
42+
return (
43+
<div>
44+
<ResizablePIP
45+
width={500}
46+
heigt={500}
47+
minConstraints={[300, 300]}
48+
maxConstraints={[800, 800]}
49+
>
50+
<p>
51+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
52+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
53+
minim veniam, quis nostrud exercitation ullamco laboris nisi ut
54+
aliquip ex ea commodo consequat. Duis aute irure dolor in
55+
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
56+
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
57+
culpa qui officia deserunt mollit anim id est laborum.
58+
</p>
59+
</ResizablePIP>
60+
</div>
61+
);
62+
}
63+
64+
export default App;
65+
```
66+
67+
#### `<ResizablePIP>` Props:
68+
69+
```ts
70+
71+
//
72+
// Props:
73+
//
74+
{
75+
// Specifies initial PIP window width.
76+
// Example: 600
77+
// Default value: 500
78+
width: number,
79+
80+
// Specifies initial PIP window height.
81+
// Example: 600
82+
// Default value: 500
83+
height: number,
84+
85+
// Specifies the minimum size possible for the PIP window (width, height).
86+
// Example: [100, 100]
87+
// Default value: [300, 300]
88+
minConstraints: [number, number]
89+
90+
// Specifies the maximum size possible for the PIP window (width, height).
91+
// Example: [900, 900]
92+
// Default value: [800, 800]
93+
maxConstraints: [number, number]
94+
}
95+
```
96+
97+
## References
98+
99+
https://www.w3.org/TR/picture-in-picture/
100+
101+
## Disclaimer
102+
103+
The origin source was forked from - https://github.com/itielMaimon/resizable-pip under MIT License
104+
105+
### License
106+
107+
MIT
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
presets: [
3+
[
4+
"@babel/env",
5+
{
6+
targets: {
7+
edge: "17",
8+
firefox: "60",
9+
chrome: "67",
10+
safari: "11.1",
11+
},
12+
useBuiltIns: "usage",
13+
corejs: "3.6.5",
14+
},
15+
],
16+
"@babel/preset-react",
17+
],
18+
};

0 commit comments

Comments
 (0)