-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat: rename blocks from lr to uc #698
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2d0bd76
feat: replaceAll from lr to uc
684c358
feat: Added the prefix uc to className via js and rename BtnUI
341e5e5
feat: Added Backward compatibility for build
306b257
feat: rename import/export from LR to UC
4d7f29c
Updated README.md
77fe52f
feat(types): added JSX types for lr-
154537d
feat: support for lr only
0fee0c8
feat: rename files
f9aed1d
Merge branch 'main' into feat/rename-blocks
egordidenko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,9 +71,9 @@ We use [JSDoc type annotations](https://www.typescriptlang.org/docs/handbook/int | |
|
||
```html | ||
<script type="module"> | ||
import * as LR from 'https://cdn.jsdelivr.net/npm/@uploadcare/file-uploader@1/web/blocks.min.js'; | ||
import * as UC from 'https://cdn.jsdelivr.net/npm/@uploadcare/file-uploader@1/web/blocks.min.js'; | ||
|
||
LR.registerBlocks(LR); | ||
UC.registerBlocks(UC); | ||
</script> | ||
``` | ||
|
||
|
@@ -82,10 +82,10 @@ We use [JSDoc type annotations](https://www.typescriptlang.org/docs/handbook/int | |
```html | ||
<link | ||
rel="stylesheet" | ||
href="https://cdn.jsdelivr.net/npm/@uploadcare/file-uploader@1/web/lr-file-uploader-regular.min.css" | ||
href="https://cdn.jsdelivr.net/npm/@uploadcare/file-uploader@1/web/uc-file-uploader-regular.min.css" | ||
/> | ||
|
||
<lr-file-uploader-regular ctx-name="my-uploader"> </lr-file-uploader-regular> | ||
<uc-file-uploader-regular ctx-name="my-uploader"> </uc-file-uploader-regular> | ||
``` | ||
|
||
3. Configure Uploadcare File Uploader and add your personal public key to the project. Discover the instructions in the [following section](#configuration). | ||
|
@@ -96,34 +96,34 @@ We use [JSDoc type annotations](https://www.typescriptlang.org/docs/handbook/int | |
2. Connect `Blocks` from your script file: | ||
|
||
```js | ||
import * as LR from '@uploadcare/file-uploader'; | ||
import * as UC from '@uploadcare/file-uploader'; | ||
|
||
LR.registerBlocks(LR); | ||
UC.registerBlocks(UC); | ||
``` | ||
|
||
3. Start using Uploadcare File Uploader in your application markup: | ||
|
||
```html | ||
<link | ||
rel="stylesheet" | ||
href="https://cdn.jsdelivr.net/npm/@uploadcare/file-uploader@1/web/lr-file-uploader-regular.min.css" | ||
href="https://cdn.jsdelivr.net/npm/@uploadcare/file-uploader@1/web/uc-file-uploader-regular.min.css" | ||
/> | ||
|
||
<lr-file-uploader-inline ctx-name="my-uploader"> </lr-file-uploader-inline> | ||
<uc-file-uploader-inline ctx-name="my-uploader"> </uc-file-uploader-inline> | ||
``` | ||
|
||
4. Configure Uploadcare File Uploader and add your personal public key to the project. Discover the instructions in the [following section](#configuration). | ||
|
||
### Configuration | ||
|
||
All configurations in Uploadcare File Uploader are managed from `lr-config` block. | ||
All configurations in Uploadcare File Uploader are managed from `uc-config` block. | ||
|
||
1. Sign up to [Uploadcare](https://app.uploadcare.com/accounts/signup/?ref=github-readme). | ||
2. Get a Public API key in [Uploadcare project's dashboard](https://app.uploadcare.com/projects/-/api-keys/?ref=github-readme). | ||
3. Add a `lr-config` block to your markup and replace `YOUR_PUBLIC_KEY` with your own public key: | ||
3. Add a `uc-config` block to your markup and replace `YOUR_PUBLIC_KEY` with your own public key: | ||
|
||
```html | ||
<lr-config ctx-name="my-uploader" pubkey="YOUR_PUBLIC_KEY"></lr-config> | ||
<uc-config ctx-name="my-uploader" pubkey="YOUR_PUBLIC_KEY"></uc-config> | ||
``` | ||
|
||
4. Make sure that your config block uses the same `ctx-name` attribute value as your solution block. | ||
|
@@ -156,7 +156,7 @@ All the source code is accessible and works in raw mode. Use _developer tools_ t | |
|
||
You’re always welcome to contribute: | ||
|
||
- Create [issues](https://github.com/uploadcare/blocks/issues) every time you feel something is missing or goes wrong. | ||
- Create [issues](https://github.com/uploadcare/file-uploader/issues) every time you feel something is missing or goes wrong. | ||
- Provide your feedback or drop us a support request at <a href="mailto:[email protected]">[email protected]</a>. | ||
- Ask questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/uploadcare) with "uploadcare" tag if others can have these questions as well. | ||
- Fork project, make changes and send it as pull request. For launching the developing mode follow these commands: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import svgIconsSprite from '../blocks/themes/lr-basic/svg-sprite.js'; | ||
import svgIconsSprite from '../blocks/themes/uc-basic/svg-sprite.js'; | ||
import { Block } from './Block.js'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dont forget to mention this path in the migration guides |
||
import { uploaderBlockCtx } from './CTX.js'; | ||
|
||
export class SolutionBlock extends Block { | ||
static styleAttrs = ['lr-wgt-common']; | ||
static styleAttrs = ['uc-wgt-common']; | ||
requireCtxName = true; | ||
init$ = uploaderBlockCtx(this); | ||
_template = null; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we could drop all this prefixing stuff out of here and simply register blocks with the provided name. All the prefixing is done on the
registerBlocks
level.