├── .github ├── ISSUE_TEMPLATE.md ├── ISSUE_TEMPLATE │ ├── 1-bug-report.md │ └── 2-feature-request.md ├── PULL_REQUEST_TEMPLATE.md ├── hooks │ ├── commit-msg │ └── pre-commit ├── scripts │ └── setup_hooks.sh └── workflows │ ├── gh-pages.yml │ ├── publish.yml │ ├── quality-check.yml │ └── scripts │ ├── quality.sh │ └── replace_template.sh ├── .gitignore ├── .gitmodules ├── .lintstagedrc ├── .prettierignore ├── .prettierrc.json ├── .releaserc.yaml ├── .stylelintignore ├── .stylelintrc.json ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── angular.json ├── bun.lock ├── commitlint.config.js ├── cypress.config.ts ├── cypress └── support │ ├── commands.ts │ ├── component-index.html │ └── component.ts ├── eslint.config.js ├── package.json ├── postcss.config.js ├── projects └── ngx-copypaste-lib │ ├── ng-package.json │ ├── package.json │ ├── src │ ├── lib │ │ ├── ngx-copypaste.directive.spec.ts │ │ └── ngx-copypaste.directive.ts │ ├── public-api.ts │ ├── test.ts │ └── test │ │ ├── copy.cy-spec.ts │ │ └── utils │ │ └── cypress-test.component.ts │ ├── tsconfig.lib.json │ ├── tsconfig.lib.prod.json │ └── tsconfig.spec.json ├── src ├── app │ ├── app.component.html │ ├── app.component.scss │ ├── app.component.spec.ts │ ├── app.component.ts │ ├── cards │ │ ├── cards.component.html │ │ ├── cards.component.scss │ │ ├── cards.component.ts │ │ ├── cards.enum.ts │ │ └── cards.type.ts │ └── shared │ │ └── copied │ │ ├── copied.component.html │ │ ├── copied.component.scss │ │ ├── copied.component.ts │ │ └── copied.path.ts ├── assets │ ├── .gitkeep │ ├── content │ │ ├── card.ts │ │ └── lists.ts │ └── images │ │ ├── content │ │ └── scroll-shadow.svg │ │ ├── open-source │ │ ├── accordion │ │ │ ├── options-active.svg │ │ │ ├── options.svg │ │ │ ├── white-chevron-down.svg │ │ │ ├── yellow-chevron-down.svg │ │ │ └── yellow-chevron-up.svg │ │ ├── cards │ │ │ ├── hand-box.svg │ │ │ └── input-vector.svg │ │ ├── footer │ │ │ └── all-rights-reserved.svg │ │ ├── header │ │ │ ├── burger.svg │ │ │ ├── close.svg │ │ │ ├── logo-white.svg │ │ │ └── logo.svg │ │ └── visit-btn │ │ │ └── button-chevron.svg │ │ └── shared │ │ ├── copied │ │ └── copied.svg │ │ └── github.svg ├── favicon.ico ├── index.html ├── main.ts └── styles.scss ├── tailwind.config.ts ├── tsconfig.app.json ├── tsconfig.eslint.json ├── tsconfig.json └── tsconfig.spec.json /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑 2 | 3 | Please help us process issues more efficiently by filing an 4 | issue using one of the following templates: 5 | 6 | https://github.com/angular/angular/issues/new/choose 7 | 8 | Thank you! 9 | 10 | 🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/1-bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "\U0001F41E Bug report" 3 | about: Report a bug in the ngx-copypaste package 4 | --- 5 | 6 | 14 | 15 | # 🐞 bug report 16 | 17 | ### Is this a regression? 18 | 19 | 20 | Yes, the previous version in which this bug was not present was: .... 21 | 22 | ### Description 23 | 24 | A clear and concise description of the problem... 25 | 26 | ## 🔬 Minimal Reproduction 27 | 28 | 31 | https://stackblitz.com/... 32 | 33 | 42 | 43 | ## 🔥 Exception or Error 44 | 45 |
46 |
47 |
48 |
49 |
50 |
51 | ## 🌍 Your Environment
52 |
53 | **Angular Version:**
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 | **Anything else relevant?**
62 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/2-feature-request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: "\U0001F680 Feature request"
3 | about: Suggest a feature for ngx-copypaste package
4 | ---
5 |
6 |
14 |
15 | # 🚀 feature request
16 |
17 | ### Description
18 |
19 | A clear and concise description of the problem or missing capability...
20 |
21 | ### Describe the solution you'd like
22 |
23 | If you have a solution in mind, please describe it.
24 |
25 | ### Describe alternatives you've considered
26 |
27 | Have you considered any alternative solutions or workarounds?
28 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## PR Checklist
2 |
3 | Please check if your PR fulfills the following requirements:
4 |
5 | - [ ] The commit message follows our guidelines: https://github.com/JsDaddy/ngx-copypaste/blob/develop/CONTRIBUTING.md#commit
6 | - [ ] Tests for the changes have been added (for bug fixes / features)
7 | - [ ] Docs have been added / updated (for bug fixes / features)
8 |
9 | ## PR Type
10 |
11 | What kind of change does this PR introduce?
12 |
13 |
14 |
15 | - [ ] Bugfix
16 | - [ ] Feature
17 | - [ ] Code style update (formatting, local variables)
18 | - [ ] Refactoring (no functional changes, no api changes)
19 | - [ ] Build related changes
20 | - [ ] CI related changes
21 | - [ ] Documentation content changes
22 | - [ ] Other... Please describe:
23 |
24 | ## What is the current behavior?
25 |
26 |
27 |
28 | Issue Number: N/A
29 |
30 | ## What is the new behavior?
31 |
32 | ## Does this PR introduce a breaking change?
33 |
34 | - [ ] Yes
35 | - [ ] No
36 |
37 |
38 |
39 | ## Other information
40 |
--------------------------------------------------------------------------------
/.github/hooks/commit-msg:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 |
5 | commit_msg=$(cat .git/COMMIT_EDITMSG)
6 | echo "$commit_msg" | bun commitlint
7 |
--------------------------------------------------------------------------------
/.github/hooks/pre-commit:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 |
5 | bun lint-staged
6 |
7 | # bun run snyk:test
8 |
9 | output=$(bun run type-coverage)
10 | if echo "$output" | grep -q "lower than "; then
11 | echo "$output"
12 | exit 1 # Terminate the hook script with a non-zero exit code
13 | else
14 | echo "Type coverage is good! 🎉"
15 | fi
16 |
17 | bun run test
18 |
19 | bun run cypress:bash
20 |
21 | bun run build
22 |
23 | bun run build:lib
24 |
--------------------------------------------------------------------------------
/.github/scripts/setup_hooks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Define the directory containing sample hooks
4 | SAMPLE_HOOKS_DIR=".github/hooks"
5 |
6 | # Define the target directory for Git hooks
7 | GIT_HOOKS_DIR=".git/hooks"
8 |
9 | # Function to copy or replace hooks
10 | copy_or_replace_hooks() {
11 | for hook in "$SAMPLE_HOOKS_DIR"/*; do
12 | hook_name=$(basename "$hook")
13 | target_hook="$GIT_HOOKS_DIR/$hook_name"
14 | if [ -f "$target_hook" ]; then
15 | echo "Replacing existing hook: $hook_name"
16 | else
17 | echo "Copying new hook: $hook_name"
18 | fi
19 | cp "$hook" "$target_hook"
20 | chmod ug+x "$target_hook" # Ensure executable permission is set
21 | done
22 | }
23 |
24 | # Main function
25 | main() {
26 | # Check if .git/hooks directory exists
27 | if [ ! -d "$GIT_HOOKS_DIR" ]; then
28 | echo "Error: .git/hooks directory not found. Are you in a Git repository?"
29 | exit 1
30 | fi
31 |
32 | # Copy or replace hooks
33 | copy_or_replace_hooks
34 |
35 | echo "Git hooks setup complete."
36 | }
37 |
38 | # Run the main function
39 | main
40 |
--------------------------------------------------------------------------------
/.github/workflows/gh-pages.yml:
--------------------------------------------------------------------------------
1 | name: GitHub pages
2 |
3 | on:
4 | push:
5 | branches:
6 | - develop
7 |
8 | jobs:
9 | build:
10 | runs-on: ubuntu-latest
11 | permissions:
12 | contents: write
13 | steps:
14 | - uses: actions/checkout@v4
15 | with:
16 | submodules: true
17 |
18 | - uses: actions/setup-node@v4
19 | with:
20 | node-version: 20
21 |
22 | - uses: oven-sh/setup-bun@v2
23 | with:
24 | bun-version: latest
25 |
26 | - name: Install deps
27 | run: |
28 | bun i
29 |
30 | - name: Semantic Release
31 | id: semantic-release
32 | env:
33 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34 | run: |
35 | npx semantic-release
36 |
37 | - name: Build demo app
38 | env:
39 | RELEASE_VERSION: ${{ steps.semantic-release.outputs.new-release-version }}
40 | run: |
41 | echo '********'
42 | echo "RELEASE_VERSION: $RELEASE_VERSION"
43 | echo '********'
44 | bash .github/workflows/scripts/replace_template.sh $RELEASE_VERSION
45 | bun run build
46 | - name: Deploy demo
47 | uses: peaceiris/actions-gh-pages@v4
48 | with:
49 | github_token: ${{ secrets.GITHUB_TOKEN }}
50 | publish_dir: ./dist/ngx-copypaste/browser
51 | outputs:
52 | version: ${{ steps.semantic-release.outputs.new-release-version }}
53 |
54 | slack_notification:
55 | needs:
56 | - build
57 | runs-on: ubuntu-latest
58 | steps:
59 | - name: Post to a Slack channel
60 | id: slack
61 | uses: slackapi/slack-github-action@v1.27.0
62 | with:
63 | channel-id: 'deployments'
64 | payload: |
65 | {
66 | "text": "GitHub Action build result: ${{ job.status == 'success' && ':white_check_mark:' || ':x:' }}",
67 | "blocks": [
68 | {
69 | "type": "section",
70 | "text": {
71 | "type": "mrkdwn",
72 | "text": "GitHub Action build result: ${{ job.status == 'success' && ':white_check_mark:' || ':x:' }}"
73 | }
74 | },
75 | {
76 | "type": "section",
77 | "text": {
78 | "type": "mrkdwn",
79 | "text": "Project: `${{ github.event.repository.name }}`"
80 | }
81 | },
82 | {
83 | "type": "section",
84 | "text": {
85 | "type": "mrkdwn",
86 | "text": "Version: `${{ needs.build.outputs.version || 'TBA' }}`"
87 | }
88 | },
89 | {
90 | "type": "section",
91 | "text": {
92 | "type": "mrkdwn",
93 | "text": "Commit/PR URL: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
94 | }
95 | },
96 | {
97 | "type": "section",
98 | "text": {
99 | "type": "mrkdwn",
100 | "text": "Website URL: ${{ secrets.WEBSITE_URL || 'TBA' }}"
101 | }
102 | }
103 | ]
104 | }
105 | env:
106 | SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
107 |
--------------------------------------------------------------------------------
/.github/workflows/publish.yml:
--------------------------------------------------------------------------------
1 | name: Publish bun
2 |
3 | on:
4 | push:
5 | branches:
6 | - master
7 |
8 | jobs:
9 | build:
10 | runs-on: ubuntu-latest
11 | outputs:
12 | version: ${{ steps.get_version.outputs.version }}
13 | steps:
14 | - uses: actions/checkout@v4
15 | with:
16 | submodules: true
17 | - uses: oven-sh/setup-bun@v2
18 | with:
19 | bun-version: latest
20 | - uses: actions/setup-node@v4
21 | with:
22 | node-version: 20
23 | registry-url: 'https://registry.npmjs.org'
24 | - name: Build library
25 | run: |
26 | bun i
27 | bun run build:lib
28 | - name: Publish library
29 | run: bun run publish:lib
30 | env:
31 | NODE_AUTH_TOKEN: ${{secrets.npm_token}}
32 | - name: Extract version
33 | id: get_version
34 | run: |
35 | VERSION=$(node -p "require('./dist/ngx-copypaste-lib/package.json').version")
36 | echo "version=$VERSION" >> $GITHUB_OUTPUT
37 |
38 | slack_notification:
39 | needs:
40 | - build
41 | runs-on: ubuntu-latest
42 | steps:
43 | - name: Post to a Slack channel
44 | id: slack
45 | uses: slackapi/slack-github-action@v1.27.0
46 | with:
47 | channel-id: 'deployments'
48 | payload: |
49 | {
50 | "text": "GitHub Action build result: ${{ job.status == 'success' && ':white_check_mark:' || ':x:' }}",
51 | "blocks": [
52 | {
53 | "type": "section",
54 | "text": {
55 | "type": "mrkdwn",
56 | "text": "GitHub Action build result: ${{ job.status == 'success' && ':white_check_mark:' || ':x:' }}"
57 | }
58 | },
59 | {
60 | "type": "section",
61 | "text": {
62 | "type": "mrkdwn",
63 | "text": "Project: `${{ github.event.repository.name }}`"
64 | }
65 | },
66 | {
67 | "type": "section",
68 | "text": {
69 | "type": "mrkdwn",
70 | "text": "Version: `${{ needs.build.outputs.version || 'TBA' }}`"
71 | }
72 | },
73 | {
74 | "type": "section",
75 | "text": {
76 | "type": "mrkdwn",
77 | "text": "Commit/PR URL: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
78 | }
79 | },
80 | {
81 | "type": "section",
82 | "text": {
83 | "type": "mrkdwn",
84 | "text": "Website URL: ${{ secrets.NPM_PACKAGE_URL }}"
85 | }
86 | }
87 | ]
88 | }
89 | env:
90 | SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
91 |
--------------------------------------------------------------------------------
/.github/workflows/quality-check.yml:
--------------------------------------------------------------------------------
1 | name: build and quality
2 |
3 | on:
4 | push:
5 | branches:
6 | - develop
7 | pull_request:
8 | branches:
9 | - develop
10 |
11 | env:
12 | snyk_token: ${{ secrets.SNYK_TOKEN }}
13 | REF: ${{ github.head_ref || github.ref_name }}
14 |
15 | jobs:
16 | quality-check:
17 | runs-on: ubuntu-latest
18 | permissions:
19 | contents: write
20 | steps:
21 | - uses: actions/checkout@v4
22 | with:
23 | submodules: true
24 | ref: ${{ env.REF }}
25 | - uses: oven-sh/setup-bun@v2
26 | with:
27 | bun-version: latest
28 | - uses: actions/setup-node@v4
29 | with:
30 | node-version: 20
31 | - name: Check quality
32 | run: |
33 | bun i
34 | bash .github/workflows/scripts/quality.sh
35 |
--------------------------------------------------------------------------------
/.github/workflows/scripts/quality.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin
2 |
3 | set -e
4 |
5 | bun run lint
6 |
7 | # bun run snyk:auth -- $snyk_token
8 | # bun run snyk:test
9 |
10 | output=$(bun run type-coverage)
11 | if echo "$output" | grep -q "lower than "; then
12 | echo "$output"
13 | exit 1 # Terminate the hook script with a non-zero exit code
14 | else
15 | echo "Type coverage is good! 🎉"
16 | fi
17 |
18 | bun run test
19 |
20 | bun run cypress:bash
21 |
22 | bun run build
23 |
24 | bun run build:lib
25 |
--------------------------------------------------------------------------------
/.github/workflows/scripts/replace_template.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Check if the correct number of arguments are provided
4 | if [ $# -ne 1 ]; then
5 | echo "Usage: $0 6 | NGX COPYPASTE is the best directive to copy any content on any element 7 |
8 | 9 | [](https://github.com/JsDaddy/ngx-copypaste/actions/workflows/main.yml) 10 | [](https://www.npmjs.com/package/ngx-copypaste) 11 | [](https://npmjs.org/ngx-copypaste) 12 | 13 | [](https://www.npmjs.com/package/ngx-copypaste) 14 | 15 | [](https://github.com/JSDaddy/ngx-copypaste) 16 | 17 | [](https://github.com/JSDaddy/ngx-copypaste) 18 | 19 | You can also try our NGX MASK [check](https://www.npmjs.com/package/ngx-mask) it. 20 | You can also try our NGX LOADER INDICATOR [check](https://www.npmjs.com/package/ngx-loader-indicator) it. 21 | 22 | ### You can try live [demo](https://jsdaddy.github.io/ngx-copypaste/) with examples. 23 | 24 | ## Installing 25 | 26 | ## npm 27 | 28 | ```bash 29 | $ npm install --save ngx-copypaste 30 | ``` 31 | 32 | ## bun 33 | 34 | ```bash 35 | $ bun install --save ngx-copypaste 36 | ``` 37 | 38 | ## Quickstart if ngx-copypaste version >= 15.0.0 39 | 40 | Pay attention this version works for angular >= 14.0.0 41 | 42 | Import **ngx-copypaste** directive to your standalone component 43 | 44 | ```typescript 45 | @Component({ 46 | selector: 'ngx-component', 47 | templateUrl: './app.component.html', 48 | styleUrls: ['./app.component.scss'], 49 | standalone: true, 50 | imports: [ 51 | (...) 52 | NgxCopyPasteDirective, 53 | (...) 54 | ], 55 | }) 56 | export class AppComponent { 57 | (...) 58 | } 59 | ``` 60 | 61 | ## Quickstart if ngx-copypaste version < 15.0.0 62 | 63 | Pay attention this version works for angular < 15.0.0 64 | 65 | Import **ngx-copypaste** module in Angular app. 66 | 67 | ```typescript 68 | import {NgxCopyPasteModule} from 'ngx-copypaste' 69 | 70 | (...) 71 | 72 | @NgModule({ 73 | (...) 74 | imports: [ 75 | NgxCopyPasteModule 76 | ] 77 | (...) 78 | }) 79 | ``` 80 | 81 | #### Usage 82 | 83 | From input 84 | 85 | ```html 86 | 87 | 88 | 89 | ``` 90 | 91 | From any HTML tag 92 | 93 | ```html 94 |Lorem ipsum
95 | 96 | 97 | ``` 98 | 99 | From complex div 100 | 101 | ```html 102 |105 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam rutrum augue at ante 106 | sollicitudin posuere. Pellentesque congue consequat enim quis luctus. 107 |
108 |Lorem ipsum
120 | 121 |Copy
122 | ``` 123 | 124 | Output success cb 125 | 126 | ```html 127 |Lorem ipsum
128 | 129 |Copy
130 | 131 | public copy(): void { your code } 132 | ``` 133 | -------------------------------------------------------------------------------- /angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "schematics": { 6 | "@schematics/angular:component": { 7 | "style": "scss", 8 | "standalone": true, 9 | "changeDetection": "OnPush", 10 | "viewEncapsulation": "Emulated" 11 | }, 12 | "@schematics/angular:directive": { 13 | "standalone": true 14 | }, 15 | "@schematics/angular:pipe": { 16 | "standalone": true 17 | }, 18 | "@schematics/angular:application": { 19 | "strict": true 20 | } 21 | }, 22 | "projects": { 23 | "ngx-copypaste": { 24 | "root": "", 25 | "sourceRoot": "src", 26 | "projectType": "application", 27 | "prefix": "app", 28 | "architect": { 29 | "build": { 30 | "builder": "@angular-devkit/build-angular:application", 31 | "options": { 32 | "security": { "autoCsp": true }, 33 | "outputPath": "dist/ngx-copypaste", 34 | "browser": "src/main.ts", 35 | "index": "src/index.html", 36 | "tsConfig": "tsconfig.app.json", 37 | "assets": ["src/favicon.ico", "src/assets"], 38 | "styles": [ 39 | "node_modules/highlight.js/styles/github.css", 40 | "src/styles.scss" 41 | ], 42 | "scripts": [], 43 | "sourceMap": true, 44 | "optimization": false, 45 | "namedChunks": true 46 | }, 47 | "configurations": { 48 | "production": { 49 | "define": { 50 | "VERSION": "'<%version%>'" 51 | }, 52 | "budgets": [ 53 | { 54 | "type": "initial", 55 | "maximumWarning": "2mb", 56 | "maximumError": "2mb" 57 | }, 58 | { 59 | "type": "anyComponentStyle", 60 | "maximumWarning": "15kb", 61 | "maximumError": "15kb" 62 | } 63 | ], 64 | "outputHashing": "all" 65 | }, 66 | "development": { 67 | "optimization": false, 68 | "extractLicenses": false, 69 | "sourceMap": true 70 | } 71 | }, 72 | "defaultConfiguration": "production" 73 | }, 74 | "serve": { 75 | "builder": "@angular-devkit/build-angular:dev-server", 76 | "options": { 77 | "buildTarget": "ngx-copypaste:build" 78 | }, 79 | "configurations": { 80 | "production": { 81 | "buildTarget": "ngx-copypaste:build:production" 82 | } 83 | } 84 | }, 85 | "test": { 86 | "builder": "@angular-devkit/build-angular:web-test-runner", 87 | "options": { 88 | "tsConfig": "tsconfig.spec.json", 89 | "inlineStyleLanguage": "scss", 90 | "assets": [ 91 | "src/favicon.ico", 92 | "src/assets", 93 | "src/robots.txt", 94 | "src/sitemap.xml" 95 | ], 96 | "polyfills": ["zone.js", "zone.js/testing"], 97 | "styles": ["src/styles.scss"], 98 | "scripts": [] 99 | } 100 | }, 101 | "lint": { 102 | "builder": "@angular-eslint/builder:lint", 103 | "options": { 104 | "lintFilePatterns": ["**/*.js", "**/*.json", "**/*.ts", "**/*.html"] 105 | } 106 | } 107 | } 108 | }, 109 | "ngx-copypaste-lib": { 110 | "projectType": "library", 111 | "root": "projects/ngx-copypaste-lib", 112 | "sourceRoot": "projects/ngx-copypaste-lib/src", 113 | "prefix": "lib", 114 | "architect": { 115 | "build": { 116 | "builder": "@angular-devkit/build-angular:ng-packagr", 117 | "options": { 118 | "project": "projects/ngx-copypaste-lib/ng-package.json" 119 | }, 120 | "configurations": { 121 | "production": { 122 | "tsConfig": "projects/ngx-copypaste-lib/tsconfig.lib.prod.json" 123 | }, 124 | "development": { 125 | "tsConfig": "projects/ngx-copypaste-lib/tsconfig.lib.json" 126 | } 127 | }, 128 | "defaultConfiguration": "production" 129 | } 130 | } 131 | } 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['@commitlint/config-conventional'], 3 | rules: { 4 | 'scope-empty': [2, 'never'], 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /cypress.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | export default defineConfig({ 4 | projectId: 'qhyo66', 5 | component: { 6 | devServer: { 7 | framework: 'angular', 8 | bundler: 'webpack', 9 | }, 10 | specPattern: 'projects/ngx-copypaste-lib/src/test/**/*.cy-spec.ts', 11 | }, 12 | }); 13 | -------------------------------------------------------------------------------- /cypress/support/commands.ts: -------------------------------------------------------------------------------- 1 | // for add commands 2 | import { mount } from 'cypress/angular'; 3 | 4 | Cypress.Commands.add('mount', mount); 5 | -------------------------------------------------------------------------------- /cypress/support/component-index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |{{ copied }}13 | `, 14 | }) 15 | export class CypressTestMaskComponent { 16 | public form: FormControl = new FormControl(''); 17 | 18 | public copied = false; 19 | public copy(): void { 20 | this.copied = true; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /projects/ngx-copypaste-lib/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../out-tsc/lib", 5 | "declaration": true, 6 | "declarationMap": true, 7 | "inlineSources": true, 8 | "types": [] 9 | }, 10 | "exclude": ["src/test.ts", "**/*.spec.ts", "src/test/**/*.ts"] 11 | } 12 | -------------------------------------------------------------------------------- /projects/ngx-copypaste-lib/tsconfig.lib.prod.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.lib.json", 3 | "compilerOptions": { 4 | "declarationMap": false 5 | }, 6 | "angularCompilerOptions": { 7 | "compilationMode": "partial" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /projects/ngx-copypaste-lib/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../out-tsc/spec", 5 | "types": ["jasmine"] 6 | }, 7 | "include": ["**/*.spec.ts", "**/*.d.ts"] 8 | } 9 | -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 |
27 |30 |28 |
29 |
Lorem ipsum dolor sit amet consectetur adipisicing elit.
`, 29 | id: 3, 30 | anchor: 'element', 31 | cardType: CardType.NONE, 32 | text12: 'Lorem ipsum dolor sit amet consectetur adipisicing elit', 33 | }, 34 | { 35 | header: 'All text in element', 36 | cardType: CardType.NONE, 37 | code: `39 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam 40 | rutrum augue at ante sollicitudin posuere. Pellentesque congue 41 | consequat enim quis luctus. 42 |
43 |