@scalar/api-client-react 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @scalar/api-client-react
2
2
 
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [c5e8b13]
8
+ - @scalar/api-client@0.12.13
9
+
3
10
  ## 0.1.0
4
11
 
5
12
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -17127,6 +17127,19 @@ pre[class*="language-"].line-numbers > code {
17127
17127
  color: var(--theme-color-green, var(--default-theme-color-green));
17128
17128
  }
17129
17129
 
17130
+ /** Hide credentials */
17131
+ .credentials {
17132
+ font-size: 0;
17133
+ color: transparent;
17134
+ }
17135
+
17136
+ /** Show a few dots instead */
17137
+ .credentials::after {
17138
+ content: '·····';
17139
+ font-size: var(--theme-small, var(--default-theme-small));
17140
+ color: var(--theme-color-3, var(--default-theme-color-3));
17141
+ }
17142
+
17130
17143
  .scalar-modal-layout[data-v-53cbffc0] {
17131
17144
  animation: modal-fade-53cbffc0 0.2s forwards;
17132
17145
  }
@@ -48238,11 +48251,42 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
48238
48251
  props: {
48239
48252
  content: {},
48240
48253
  lang: { default: "js" },
48241
- lineNumbers: { type: Boolean, default: false }
48254
+ lineNumbers: { type: Boolean, default: false },
48255
+ hideCredentials: {}
48242
48256
  },
48243
48257
  setup(__props) {
48244
48258
  const props = __props;
48245
48259
  const { plugins, highlightElement } = prismjs;
48260
+ if (props.hideCredentials) {
48261
+ prismjs.hooks.add("wrap", function(env) {
48262
+ if (!props.hideCredentials) {
48263
+ return;
48264
+ }
48265
+ let showsCredentials = false;
48266
+ if (typeof props.hideCredentials === "string") {
48267
+ if (env.content.includes(props.hideCredentials)) {
48268
+ showsCredentials = true;
48269
+ }
48270
+ } else if (Array.isArray(props.hideCredentials)) {
48271
+ showsCredentials = props.hideCredentials.some(
48272
+ (token) => env.content.includes(token)
48273
+ );
48274
+ }
48275
+ if (showsCredentials) {
48276
+ env.content = env.content.replace(
48277
+ /<span class="credentials">.*?<\/span>/g,
48278
+ (match) => match.replace(/<span class="credentials">|<\/span>/g, "")
48279
+ );
48280
+ env.content = env.content.replace(
48281
+ new RegExp(
48282
+ typeof props.hideCredentials === "string" ? props.hideCredentials : props.hideCredentials.join("|"),
48283
+ "g"
48284
+ ),
48285
+ (match) => `<span class="credentials">${match}</span>`
48286
+ );
48287
+ }
48288
+ });
48289
+ }
48246
48290
  const el = ref(null);
48247
48291
  const language2 = computed(() => {
48248
48292
  return props.lang === "node" ? "js" : props.lang;
package/dist/index.js CHANGED
@@ -17125,6 +17125,19 @@ pre[class*="language-"].line-numbers > code {
17125
17125
  color: var(--theme-color-green, var(--default-theme-color-green));
17126
17126
  }
17127
17127
 
17128
+ /** Hide credentials */
17129
+ .credentials {
17130
+ font-size: 0;
17131
+ color: transparent;
17132
+ }
17133
+
17134
+ /** Show a few dots instead */
17135
+ .credentials::after {
17136
+ content: '·····';
17137
+ font-size: var(--theme-small, var(--default-theme-small));
17138
+ color: var(--theme-color-3, var(--default-theme-color-3));
17139
+ }
17140
+
17128
17141
  .scalar-modal-layout[data-v-53cbffc0] {
17129
17142
  animation: modal-fade-53cbffc0 0.2s forwards;
17130
17143
  }
@@ -48236,11 +48249,42 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
48236
48249
  props: {
48237
48250
  content: {},
48238
48251
  lang: { default: "js" },
48239
- lineNumbers: { type: Boolean, default: false }
48252
+ lineNumbers: { type: Boolean, default: false },
48253
+ hideCredentials: {}
48240
48254
  },
48241
48255
  setup(__props) {
48242
48256
  const props = __props;
48243
48257
  const { plugins, highlightElement } = prismjs;
48258
+ if (props.hideCredentials) {
48259
+ prismjs.hooks.add("wrap", function(env) {
48260
+ if (!props.hideCredentials) {
48261
+ return;
48262
+ }
48263
+ let showsCredentials = false;
48264
+ if (typeof props.hideCredentials === "string") {
48265
+ if (env.content.includes(props.hideCredentials)) {
48266
+ showsCredentials = true;
48267
+ }
48268
+ } else if (Array.isArray(props.hideCredentials)) {
48269
+ showsCredentials = props.hideCredentials.some(
48270
+ (token) => env.content.includes(token)
48271
+ );
48272
+ }
48273
+ if (showsCredentials) {
48274
+ env.content = env.content.replace(
48275
+ /<span class="credentials">.*?<\/span>/g,
48276
+ (match) => match.replace(/<span class="credentials">|<\/span>/g, "")
48277
+ );
48278
+ env.content = env.content.replace(
48279
+ new RegExp(
48280
+ typeof props.hideCredentials === "string" ? props.hideCredentials : props.hideCredentials.join("|"),
48281
+ "g"
48282
+ ),
48283
+ (match) => `<span class="credentials">${match}</span>`
48284
+ );
48285
+ }
48286
+ });
48287
+ }
48244
48288
  const el = ref(null);
48245
48289
  const language2 = computed(() => {
48246
48290
  return props.lang === "node" ? "js" : props.lang;
@@ -17128,6 +17128,19 @@ pre[class*="language-"].line-numbers > code {
17128
17128
  color: var(--theme-color-green, var(--default-theme-color-green));
17129
17129
  }
17130
17130
 
17131
+ /** Hide credentials */
17132
+ .credentials {
17133
+ font-size: 0;
17134
+ color: transparent;
17135
+ }
17136
+
17137
+ /** Show a few dots instead */
17138
+ .credentials::after {
17139
+ content: '·····';
17140
+ font-size: var(--theme-small, var(--default-theme-small));
17141
+ color: var(--theme-color-3, var(--default-theme-color-3));
17142
+ }
17143
+
17131
17144
  .scalar-modal-layout[data-v-53cbffc0] {
17132
17145
  animation: modal-fade-53cbffc0 0.2s forwards;
17133
17146
  }
@@ -48239,11 +48252,42 @@ a[data-v-ffc7287f] {
48239
48252
  props: {
48240
48253
  content: {},
48241
48254
  lang: { default: "js" },
48242
- lineNumbers: { type: Boolean, default: false }
48255
+ lineNumbers: { type: Boolean, default: false },
48256
+ hideCredentials: {}
48243
48257
  },
48244
48258
  setup(__props) {
48245
48259
  const props = __props;
48246
48260
  const { plugins, highlightElement } = prismjs;
48261
+ if (props.hideCredentials) {
48262
+ prismjs.hooks.add("wrap", function(env) {
48263
+ if (!props.hideCredentials) {
48264
+ return;
48265
+ }
48266
+ let showsCredentials = false;
48267
+ if (typeof props.hideCredentials === "string") {
48268
+ if (env.content.includes(props.hideCredentials)) {
48269
+ showsCredentials = true;
48270
+ }
48271
+ } else if (Array.isArray(props.hideCredentials)) {
48272
+ showsCredentials = props.hideCredentials.some(
48273
+ (token) => env.content.includes(token)
48274
+ );
48275
+ }
48276
+ if (showsCredentials) {
48277
+ env.content = env.content.replace(
48278
+ /<span class="credentials">.*?<\/span>/g,
48279
+ (match) => match.replace(/<span class="credentials">|<\/span>/g, "")
48280
+ );
48281
+ env.content = env.content.replace(
48282
+ new RegExp(
48283
+ typeof props.hideCredentials === "string" ? props.hideCredentials : props.hideCredentials.join("|"),
48284
+ "g"
48285
+ ),
48286
+ (match) => `<span class="credentials">${match}</span>`
48287
+ );
48288
+ }
48289
+ });
48290
+ }
48247
48291
  const el = ref(null);
48248
48292
  const language2 = computed(() => {
48249
48293
  return props.lang === "node" ? "js" : props.lang;
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "testing",
15
15
  "react"
16
16
  ],
17
- "version": "0.1.0",
17
+ "version": "0.1.1",
18
18
  "engines": {
19
19
  "node": ">=18"
20
20
  },
@@ -44,7 +44,7 @@
44
44
  "dependencies": {
45
45
  "react": "^18.2.0",
46
46
  "vue": "^3.3.0",
47
- "@scalar/api-client": "0.12.12"
47
+ "@scalar/api-client": "0.12.13"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@types/react": "^18.2.60",